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-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 + 610 files changed, 101580 insertions(+) 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 (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core') 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} + -- cgit 1.2.3-korg