From 51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Sun, 10 Dec 2017 18:55:03 +0200 Subject: [PATCH] Final commit to master merge from Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507 Issue-ID: SDC-714 Signed-off-by: Tal Gitelman --- .gitignore | 70 +- LICENSE.TXT | 3 +- asdc-tests/pom.xml | 3 +- .../org/openecomp/sdc/ci/tests/api/AttSdcTest.java | 4 +- .../sdc/ci/tests/api/ComponentBaseTest.java | 1 - .../ci/tests/api/ComponentInstanceBaseTest.java | 6 +- .../sdc/ci/tests/datatypes/ArtifactReqDetails.java | 1 - .../sdc/ci/tests/datatypes/ImportReqDetails.java | 3 - .../datatypes/ResourceExternalReqDetails.java | 1 - .../sdc/ci/tests/datatypes/ServiceReqDetails.java | 12 +- .../tests/datatypes/enums/LifeCycleStatesEnum.java | 2 - .../ci/tests/datatypes/enums/PropertyTypeEnum.java | 1 - .../execute/TODO/ImportCapabilityTypeCITest.java | 8 +- .../execute/artifacts/ArtifactServletTest.java | 2 - .../execute/artifacts/PlaceHolderValidations.java | 8 - .../execute/artifacts/ValidateArtResponse.java | 14 +- .../tests/execute/category/CatalogDataApiTest.java | 12 +- .../ci/tests/execute/category/CategoriesTests.java | 2 - .../ci/tests/execute/category/ElementsApiTest.java | 1 - .../ci/tests/execute/category/GroupingTest.java | 4 - .../tests/execute/category/SubCategoriesTest.java | 1 - .../ci/tests/execute/devCI/CRUDExternalAPI.java | 5 +- .../sdc/ci/tests/execute/devCI/HealthCheckAPI.java | 41 +- .../ci/tests/execute/devCI/ImportCsarUpdate.java | 6 - .../execute/devCI/ImportCsarValidateArtifacts.java | 5 - .../tests/execute/devCI/OpsRejectDistribution.java | 7 - .../devCI/SearchFilterCategoryExternalAPI.java | 59 - .../ci/tests/execute/devCI/ToscaGroupInsideVF.java | 2 - .../ci/tests/execute/devCI/VFCMTExternalAPI.java | 2 - .../execute/devCI/ValidateConformanceLevel.java | 4 - .../sdc/ci/tests/execute/devCI/test1.java | 7 - .../sdc/ci/tests/execute/externalapi/UserAPIs.java | 9 +- .../general/BasicHttpAuthenticationTest.java | 1 - .../general/ManageEcompConsumerCredentials.java | 1 - .../ci/tests/execute/imports/ExportToscaTest.java | 11 +- .../FilteredDataByParamsComponentServletTest.java | 9 - .../execute/imports/ImportCsarResourceTest.java | 9 +- .../imports/ImportGenericResourceCITest.java | 2 - .../execute/imports/ImportToscaResourceTest.java | 16 +- .../imports/ImportUpdateResourseCsarTest.java | 1 - .../execute/imports/ToscaTemplateVersionTest.java | 12 +- .../property/ComponentInstancePropertyTest.java | 1 - .../tests/execute/property/PropertyApisTest.java | 4 - .../tests/execute/resource/CheckGetResource.java | 1 - .../resource/ComponentRelationshipInVfTest.java | 47 +- .../execute/resource/CreateResourceApiTest.java | 9 - .../execute/resource/GetAllResourceVersions.java | 2 - .../tests/execute/resource/GetLeftPaletteTest.java | 12 +- .../resource/GetResourceNotAbstractApiTest.java | 2 - .../ci/tests/execute/resource/ResourceApiTest.java | 1 - .../resource/UpdateResourceMetadataTest.java | 1 - .../resource/VFResourceInstanceNameCRUD.java | 1 - .../execute/resource/ValidateExtendedVfData.java | 4 - .../resource/VfComponentInstanceCRUDTest.java | 11 +- .../ChangeServiceDistributionStatusApiTest.java | 4 - .../service/CreateServiceMetadataApiTest.java | 4 - .../execute/service/GetAllServiceVersions.java | 1 - .../execute/service/GetComponentAuditApiTest.java | 3 - .../service/GetServiceLatestVersionTest.java | 1 - .../execute/service/ReqCapOccurrencesTest.java | 11 +- .../service/ServiceComponentInstanceCRUDTest.java | 11 +- .../execute/service/UpdateServiceMetadataTest.java | 10 +- .../execute/user/GovernorWorkspaceApiTest.java | 2 - .../migration/v1707/CommonMigrationUtils.java | 4 +- .../postupgrade/AttKeyPropertiesRenameTest.java | 18 +- .../AttKeyPropertiesBeforeRenameTest.java | 9 +- .../ci/tests/sanity/MultipleResourceUpdate.java | 5 +- .../org/openecomp/sdc/ci/tests/utils/DbUtils.java | 21 +- .../org/openecomp/sdc/ci/tests/utils/ReqCap.java | 6 +- .../ci/tests/utils/cassandra/CassandraUtils.java | 21 +- .../ci/tests/utils/cassandra/CassandraUtils2.java | 20 +- .../sdc/ci/tests/utils/general/Convertor.java | 3 - .../sdc/ci/tests/utils/general/ElementFactory.java | 14 +- .../sdc/ci/tests/utils/general/ImportUtils.java | 6 - .../sdc/ci/tests/utils/graph/GraphFileUtils.java | 9 +- .../sdc/ci/tests/utils/rest/AssetRestUtils.java | 2 - .../sdc/ci/tests/utils/rest/CatalogRestUtils.java | 6 +- .../sdc/ci/tests/utils/rest/CommonRestUtils.java | 3 +- .../sdc/ci/tests/utils/rest/ImportRestUtils.java | 1 - .../sdc/ci/tests/utils/rest/ProductRestUtils.java | 4 +- .../sdc/ci/tests/utils/rest/ResourceRestUtils.java | 4 +- .../utils/rest/ResourceRestUtilsExternalAPI.java | 1 - .../sdc/ci/tests/utils/rest/ResponseParser.java | 2 - .../utils/validation/ArtifactValidationUtils.java | 2 - .../utils/validation/BaseValidationUtils.java | 1 - .../utils/validation/CategoryValidationUtils.java | 3 +- .../utils/validation/ErrorValidationUtils.java | 2 +- .../utils/validation/ServiceValidationUtils.java | 3 +- .../ci/tests/utils/validation/TestYamlParser.java | 2 - .../utils/validation/UserValidationUtils.java | 2 +- asdctool/pom.xml | 119 +- .../ArtifactUUIDFixConfiguration.java | 327 ++ .../configuration/ConfigurationUploader.java | 28 + .../sdc/asdctool/impl/ArtifactUuidFix.java | 1202 ++++++ .../asdctool/impl/validator/ArtifactToolBL.java | 38 + .../validator/config/ValidationConfigManager.java | 12 +- .../config/ValidationToolConfiguration.java | 18 + .../executers/ArtifactValidatorExecuter.java | 145 + .../executers/IArtifactValidatorExecuter.java | 9 + .../NodeToscaArtifactsValidatorExecuter.java | 41 + .../ServiceToscaArtifactsValidatorExecutor.java | 39 + .../VFToscaArtifactValidatorExecutor.java | 43 + .../impl/validator/utils/ReportManager.java | 2 +- .../sdc/asdctool/main/ArtifactUUIDFixMenu.java | 45 + .../sdc/asdctool/main/ArtifactValidatorTool.java | 46 + .../sdc/asdctool/main/UpdateIsVnfMenu.java | 1 - .../sdc/asdctool/main/ValidationTool.java | 2 +- .../migration/config/MigrationSpringConfig.java | 309 +- .../asdctool/migration/core/SdcMigrationTool.java | 10 +- .../core/execution/MigrationExecutionResult.java | 4 +- .../core/execution/MigrationExecutor.java | 4 +- .../core/execution/MigrationExecutorImpl.java | 8 +- .../migration/core/task/IMigrationStage.java | 20 + .../asdctool/migration/core/task/Migration.java | 16 +- .../migration/core/task/PostMigration.java | 19 + .../asdctool/migration/dao/MigrationTasksDao.java | 20 +- .../sdc/asdctool/migration/main/MigrationMenu.java | 13 +- .../migration/resolver/MigrationResolver.java | 6 +- .../resolver/SpringBeansMigrationResolver.java | 29 +- .../asdctool/migration/service/SdcRepoService.java | 4 +- .../migration/tasks/handlers/OutputHandler.java | 9 + .../migration/tasks/handlers/XlsOutputHandler.java | 66 + .../tasks/mig1710/UpgradeMigration1710.java | 739 ++++ .../servlets/ExportImportTitanServlet.java | 4 +- .../resources/config/Artifact-Generator.properties | 264 ++ .../src/main/resources/config/configuration.yaml | 195 +- .../src/main/resources/config/elasticsearch.yml | 7 +- .../src/main/resources/config/titan.properties | 9 +- asdctool/src/main/resources/elasticsearch.yml | 399 ++ asdctool/src/main/resources/scripts/UUIDFix1707.sh | 4 +- .../resources/scripts/artifactsIdValidation.sh | 32 + .../src/main/resources/scripts/sdc-migration.sh | 3 + .../resources/scripts/upgradePostMigration1710.sh | 33 + .../sdc/asdctool/enums/SchemaZipFileEnumTest.java | 2 - .../config/ValidationConfigManagerTest.java | 12 - .../config/ValidationToolConfigurationTest.java | 16 - .../executers/ServiceValidatorExecuterTest.java | 2 - .../TopologyTemplateValidatorExecuterTest.java | 5 - .../executers/VfValidatorExecuterTest.java | 2 - .../tasks/artifacts/ArtifactsVertexResultTest.java | 2 - .../ServiceArtifactValidationTaskTest.java | 6 - .../artifacts/VfArtifactValidationTaskTest.java | 7 - .../impl/validator/utils/ElementTypeEnumTest.java | 2 - .../validator/utils/ValidationTaskResultTest.java | 2 - .../impl/validator/utils/VertexResultTest.java | 2 - .../config/MigrationSpringConfigTest.java | 2 - .../sdc/asdctool/migration/core/DBVersionTest.java | 4 +- .../migration/core/SdcMigrationToolTest.java | 14 +- .../core/execution/MigrationExecutorImplTest.java | 7 +- .../migration/core/task/MigrationResultTest.java | 2 - .../resolver/SpringBeansMigrationResolverTest.java | 26 +- .../asdctool/migration/scanner/ClassScanner.java | 6 +- .../migration/service/SdcRepoServiceTest.java | 12 +- .../migration/task/MigrationTasksTest.java | 13 +- .../tasks/mig1710/UpgradeMigration1710Test.java | 265 ++ .../sdc/asdctool/servlets/EntryPointTest.java | 2 - catalog-be/.gitignore | 8 - catalog-be/pom.xml | 61 +- .../sdc/be/auditing/api/IAuditingManager.java | 2 - .../auditing/impl/AuditingLogFormatConstants.java | 59 +- .../be/auditing/impl/AuditingLogFormatUtil.java | 2 - .../clean/AsdcComponentsCleanerTask.java | 2 +- .../distribution/engine/CambriaHandler.java | 190 +- .../distribution/engine/DistributionEngine.java | 1 - .../engine/DistributionEngineClusterHealth.java | 10 +- .../distribution/engine/INotificationData.java | 4 + .../distribution/engine/NotificationDataImpl.java | 20 +- .../ServiceDistributionArtifactsBuilder.java | 16 +- .../engine/VfModuleArtifactPayload.java | 2 - .../be/components/impl/ArtifactResolverImpl.java | 14 +- .../be/components/impl/ArtifactsBusinessLogic.java | 515 ++- .../be/components/impl/AttributeBusinessLogic.java | 1 - .../sdc/be/components/impl/BaseBusinessLogic.java | 55 +- .../be/components/impl/CassandraHealthCheck.java | 2 - .../be/components/impl/CommonImportManager.java | 3 +- .../be/components/impl/ComponentBusinessLogic.java | 137 +- .../impl/ComponentInstanceBusinessLogic.java | 972 +++-- .../components/impl/CompositionBusinessLogic.java | 2 +- .../be/components/impl/CsarValidationUtils.java | 2 - .../impl/DistributionMonitoringBusinessLogic.java | 9 +- .../be/components/impl/ElementBusinessLogic.java | 42 +- .../sdc/be/components/impl/GroupBusinessLogic.java | 12 +- .../be/components/impl/GroupTypeImportManager.java | 18 +- .../components/impl/HealthCheckBusinessLogic.java | 232 +- .../sdc/be/components/impl/ImportUtils.java | 10 +- .../InformationDeployedArtifactsBusinessLogic.java | 25 - .../be/components/impl/InputsBusinessLogic.java | 27 +- .../components/impl/PolicyTypeImportManager.java | 12 +- .../ProductComponentInstanceBusinessLogic.java | 3 - .../be/components/impl/PropertyBusinessLogic.java | 31 +- .../be/components/impl/ResourceBusinessLogic.java | 295 +- .../be/components/impl/ResourceImportManager.java | 54 +- .../be/components/impl/ResponseFormatManager.java | 3 - .../be/components/impl/ServiceBusinessLogic.java | 39 +- .../impl/VFComponentInstanceBusinessLogic.java | 7 - .../impl/generic/GenericTypeBusinessLogic.java | 91 + .../lifecycle/CertificationChangeTransition.java | 1 + .../lifecycle/CertificationRequestTransition.java | 32 +- .../components/lifecycle/CheckoutTransition.java | 21 +- .../components/lifecycle/LifeCycleTransition.java | 6 +- .../lifecycle/LifecycleBusinessLogic.java | 16 +- .../lifecycle/LifecycleChangeInfoWithAction.java | 2 +- .../lifecycle/StartCertificationTransition.java | 5 +- .../lifecycle/UndoCheckoutTransition.java | 1 + .../merge/GlobalInputsFilteringBusinessLogic.java | 36 + .../merge/GlobalTypesMergeBusinessLogic.java | 41 + .../be/components/merge/RelationsComparator.java | 95 + .../be/components/merge/TopologyComparator.java | 105 + .../heat/HeatEnvArtifactsMergeBusinessLogic.java | 64 + .../merge/input/ComponentInputsMergeBL.java | 60 + .../input/InputsValuesMergingBusinessLogic.java | 180 + .../instance/ComponentInstanceArtifactsMerge.java | 101 + .../instance/ComponentInstanceHeatEnvMerge.java | 63 + .../ComponentInstanceMergeDataBusinessLogic.java | 90 + .../instance/ComponentInstanceMergeInterface.java | 18 + .../ComponentInstancePropsAndInputsMerge.java | 131 + .../merge/instance/DataForMergeHolder.java | 114 + .../merge/property/ComplexPropertyValueMerger.java | 17 + .../property/ComponentInstanceInputsMergeBL.java | 72 + .../ComponentInstancePropertiesMergeBL.java | 73 + .../DataDefinitionsValuesMergingBusinessLogic.java | 43 + .../merge/property/MergePropertyData.java | 52 + .../PropertyDataValueMergeBusinessLogic.java | 164 + .../property/PropertyInstanceMergeDataBuilder.java | 79 + .../merge/property/PropertyValueMerger.java | 148 + .../merge/property/ScalarPropertyValueMerger.java | 20 + .../merge/resource/MergeResourceBLFactory.java | 33 + .../merge/resource/MergeResourceBusinessLogic.java | 10 + .../resource/ResourceDataMergeBusinessLogic.java | 62 + .../validation/ComponentValidations.java | 6 +- .../sdc/be/exception/SdcActionException.java | 16 + .../servlet/ArtifactExternalServlet.java | 4 +- .../org/openecomp/sdc/be/impl/ComponentsUtils.java | 35 +- .../sdc/be/impl/DownloadArtifactLogic.java | 1 - .../sdc/be/info/ArtifactDefinitionInfo.java | 1 - .../sdc/be/info/ArtifactTemplateInfo.java | 16 +- .../openecomp/sdc/be/info/GroupDefinitionInfo.java | 1 + .../openecomp/sdc/be/info/MergedArtifactInfo.java | 4 +- .../sdc/be/listen/BEAppContextListener.java | 18 +- .../be/servlets/AdditionalInformationServlet.java | 4 +- .../openecomp/sdc/be/servlets/ArtifactServlet.java | 4 +- .../sdc/be/servlets/AttributeServlet.java | 4 +- .../sdc/be/servlets/BeGenericServlet.java | 2 - .../sdc/be/servlets/BeMonitoringServlet.java | 32 +- .../sdc/be/servlets/ComponentInstanceServlet.java | 221 +- .../sdc/be/servlets/ComponentServlet.java | 15 +- .../openecomp/sdc/be/servlets/ConsumerServlet.java | 4 +- .../be/servlets/DistributionServiceServlet.java | 4 +- .../openecomp/sdc/be/servlets/ElementServlet.java | 43 +- .../openecomp/sdc/be/servlets/GroupServlet.java | 7 +- .../openecomp/sdc/be/servlets/InputsServlet.java | 7 +- .../sdc/be/servlets/LifecycleServlet.java | 4 +- .../openecomp/sdc/be/servlets/ProductServlet.java | 6 +- .../openecomp/sdc/be/servlets/PropertyServlet.java | 4 +- .../sdc/be/servlets/RequirementsServlet.java | 1 + .../sdc/be/servlets/ResourceUploadServlet.java | 1 + .../sdc/be/servlets/ResourcesServlet.java | 4 +- .../openecomp/sdc/be/servlets/ServiceServlet.java | 5 +- .../sdc/be/servlets/TypesFetchServlet.java | 10 +- .../sdc/be/servlets/TypesUploadServlet.java | 8 +- .../sdc/be/servlets/UserAdminServlet.java | 4 +- .../be/switchover/detector/SwitchoverDetector.java | 2 +- .../be/tosca/CapabiltyRequirementConvertor.java | 79 +- .../java/org/openecomp/sdc/be/tosca/CsarUtils.java | 79 +- .../openecomp/sdc/be/tosca/PropertyConvertor.java | 6 +- .../openecomp/sdc/be/tosca/ToscaExportHandler.java | 270 +- .../sdc/be/tosca/model/ToscaMetadata.java | 40 +- .../openecomp/sdc/be/user/UserBusinessLogic.java | 1 - .../common/transaction/mngr/RollbackManager.java | 10 +- .../src/main/resources/application-context.xml | 1 + .../src/main/resources/config/configuration.yaml | 29 +- .../main/resources/config/error-configuration.yaml | 26 + .../tosca/capability-types/capabilityTypes.yml | 5 + .../tosca/capability-types/capabilityTypes.zip | Bin 1598 -> 1676 bytes .../import/tosca/categories/categoryTypes.yml | 9 + .../import/tosca/categories/categoryTypes.zip | Bin 1079 -> 1109 bytes .../import/tosca/data-types/dataTypes.yml | 17 + .../import/tosca/data-types/dataTypes.zip | Bin 6242 -> 6601 bytes .../tosca/heat-types/Generic_VF/Generic_VF.yml | 5 +- .../tosca/heat-types/Generic_VF/Generic_VF.zip | Bin 436 -> 460 bytes .../heat-types/extContrailCP/extContrailCP.json | 21 + .../heat-types/extContrailCP/extContrailCP.yml | 59 + .../heat-types/extContrailCP/extContrailCP.zip | Bin 0 -> 665 bytes .../import/tosca/heat-types/extCp2/extCp2.json | 21 + .../import/tosca/heat-types/extCp2/extCp2.yml | 8 + .../import/tosca/heat-types/extCp2/extCp2.zip | Bin 0 -> 347 bytes .../heat-types/extNeutronCP/extNeutronCP.json | 21 + .../tosca/heat-types/extNeutronCP/extNeutronCP.yml | 140 + .../tosca/heat-types/extNeutronCP/extNeutronCP.zip | Bin 0 -> 1193 bytes .../import/tosca/heat-types/extVl/extVl.yml | 2 +- .../import/tosca/heat-types/extVl/extVl.zip | Bin 767 -> 762 bytes .../heat-types/portMirroring/portMirroring.json | 21 + .../heat-types/portMirroring/portMirroring.yml | 11 + .../heat-types/portMirroring/portMirroring.zip | Bin 0 -> 711 bytes .../portMirroringByPolicy.json | 21 + .../portMirroringByPolicy.yml | 26 + .../portMirroringByPolicy.zip | Bin 0 -> 909 bytes .../heat-types/serviceProxy/serviceProxy.json | 21 + .../tosca/heat-types/serviceProxy/serviceProxy.yml | 4 + .../tosca/heat-types/serviceProxy/serviceProxy.zip | Bin 0 -> 557 bytes .../scripts/import/tosca/importHeatTypes.py | 9 +- .../scripts/import/tosca/importNormativeAll.py | 6 +- .../scripts/import/tosca/importONAPNormativeAll.py | 140 + .../scripts/import/tosca/typesToUpgrade.json | 58 +- .../scripts/import/tosca/upgradeNormative.py | 4 - .../scripts/import/tosca/upgradeONAPNormative.py | 124 + .../src/test/java/org/openecomp/sdc/ZipUtil.java | 2 - .../sdc/be/DummyConfigurationManager.java | 40 + .../sdc/be/components/AuditingManagerTest.java | 6 +- .../be/components/ComponentBusinessLogicTest.java | 75 +- .../sdc/be/components/GroupBusinessLogicTest.java | 12 - .../components/HealthCheckBusinessLogicTest.java | 23 +- .../be/components/PropertyBusinessLogicTest.java | 31 +- .../be/components/ResourceImportManagerTest.java | 7 +- .../be/components/ServiceBusinessLogicTest.java | 11 +- .../clean/AsdcComponentsCleanerTaskTest.java | 2 - .../engine/DistributionEngineConfigTest.java | 4 +- .../engine/DistributionEngineHealthCheckTest.java | 4 - .../engine/DistributionEngineInitTaskTest.java | 31 +- .../engine/VfModuleArtifactPayloadTest.java | 3 - .../AdditionalInformationBusinessLogicTest.java | 1 - .../components/impl/ArtifactBusinessLogicTest.java | 168 +- .../be/components/impl/ArtifactResolverTest.java | 12 +- .../impl/AttributeBusinessLogicTest.java | 3 - .../impl/CapabilityTypeImportManagerTest.java | 2 - .../impl/CategoriesImportManagerTest.java | 15 +- .../impl/ComponentInstanceBusinessLogicTest.java | 245 ++ .../impl/CompositionBusinessLogicTest.java | 1 - .../components/impl/ConsumerBusinessLogicTest.java | 4 - .../components/impl/CsarValidationUtilsTest.java | 2 +- .../components/impl/ElementBusinessLogicTest.java | 25 - .../be/components/impl/GroupBusinessLogicTest.java | 2 - .../sdc/be/components/impl/ImportUtilsTest.java | 5 +- .../components/impl/InputsBusinessLogicTest.java | 20 +- .../InterfaceLifecycleTypeImportManagerTest.java | 2 - .../components/impl/ProductBusinessLogicTest.java | 3 - .../components/impl/ResourceBusinessLogicTest.java | 1253 ++---- .../impl/ResourceInstanceBusinessLogicTest.java | 23 +- .../impl/generic/GenericTypeBusinessLogicTest.java | 97 + .../CertificationChangeTransitionTest.java | 13 +- .../lifecycle/CertificationRequestTest.java | 57 +- .../sdc/be/components/lifecycle/CheckinTest.java | 8 +- .../sdc/be/components/lifecycle/CheckoutTest.java | 13 +- .../be/components/lifecycle/LifecycleTestBase.java | 27 +- .../be/components/lifecycle/UndoCheckoutTest.java | 5 +- .../GlobalInputsFilteringBusinessLogicTest.java | 86 + .../merge/GlobalTypesMergeBusinessLogicTest.java | 62 + .../components/merge/RelationsComparatorTest.java | 112 + .../components/merge/TopologyComparatorTest.java | 119 + .../HeatEnvArtifactsMergeBusinessLogicTest.java | 112 + .../merge/input/ComponentInputsMergeBLTest.java | 94 + .../InputsValuesMergingBusinessLogicTest.java | 186 + .../ComponentInstanceArtifactsMergeTest.java | 88 + .../instance/ComponentInstanceDataMergingTest.java | 16 + .../ComponentInstanceHeatEnvMergeTest.java | 101 + ...omponentInstanceMergeDataBusinessLogicTest.java | 115 + .../ComponentInstancePropsAndInputsMergeTest.java | 154 + .../ComponentInstanceInputsMergeBLTest.java | 120 + .../ComponentInstancePropertiesMergeBLTest.java | 114 + ...aDefinitionsValuesMergingBusinessLogicTest.java | 122 + .../PropertyDataValueMergeBusinessLogicTest.java | 253 ++ .../ResourceDataMergeBusinessLogicTest.java | 82 + .../sdc/be/components/utils/ArtifactBuilder.java | 42 + .../components/utils/ComponentInstanceBuilder.java | 49 + .../be/components/utils/HeatParameterBuilder.java | 36 + .../sdc/be/components/utils/ObjectGenerator.java | 101 + .../utils/PropertyDataDefinitionBuilder.java | 68 + .../sdc/be/components/utils/RelationsBuilder.java | 53 + .../sdc/be/components/utils/ResourceBuilder.java | 126 + .../DistributionBusinessLogicTest.java | 2 - .../ServiceDistributionArtifactsBuilderTest.java | 21 +- .../openecomp/sdc/be/distribution/TestQueue.java | 188 + .../servlet/DistributionServletTest.java | 1 - .../sdc/be/ecomp/GenerateEcompErrorFileTest.java | 6 +- .../externalapi/servlet/AssetsDataServletTest.java | 39 +- .../representation/ArtifactMetadataTest.java | 2 - .../representation/ProductAssetMetadataTest.java | 2 - .../ProductCategoryGroupMetadataTest.java | 2 - .../ResourceAssetDetailedMetadataTest.java | 2 - .../representation/ResourceAssetMetadataTest.java | 2 - .../ResourceInstanceMetadataTest.java | 2 - .../ServiceAssetDetailedMetadataTest.java | 2 - .../representation/ServiceAssetMetadataTest.java | 2 - .../openecomp/sdc/be/impl/ComponentsUtilsTest.java | 20 - .../sdc/be/info/ArtifactAccessInfoTest.java | 2 - .../sdc/be/info/ArtifactAccessListTest.java | 2 - .../sdc/be/info/ArtifactDefinitionInfoTest.java | 2 - .../sdc/be/info/ArtifactTemplateInfoTest.java | 5 +- .../sdc/be/info/ArtifactTypesInfoTest.java | 2 - .../sdc/be/info/CreateAndAssotiateInfoTest.java | 2 - .../sdc/be/info/DistributionStatusInfoTest.java | 2 - .../info/DistributionStatusListResponseTest.java | 2 - .../info/DistributionStatusOfServiceInfoTest.java | 2 - ...istributionStatusOfServiceListResponceTest.java | 2 - .../sdc/be/info/GroupDefinitionInfoTest.java | 4 - .../sdc/be/info/GroupTemplateInfoTest.java | 2 - .../org/openecomp/sdc/be/info/ServiceInfoTest.java | 2 - .../sdc/be/info/ServiceVersionInfoTest.java | 2 - .../openecomp/sdc/be/info/ServicesWrapperTest.java | 2 - .../sdc/be/info/ServletJsonResponseTest.java | 2 - .../sdc/be/info/ToscaNodeTypeInfoTest.java | 2 - .../sdc/be/info/ToscaNodeTypeInterfaceTest.java | 2 - .../servlets/AbstractValidationsServletTest.java | 17 - .../servlets/AdditionalInformationServletTest.java | 4 - .../sdc/be/servlets/ApplicationConfig.java | 1 - .../sdc/be/servlets/ArtifactServletTest.java | 3 - .../sdc/be/servlets/AttributeServletTest.java | 1 - .../be/servlets/ComponentInstanceServletTest.java | 419 +- .../sdc/be/servlets/ComponentServletTest.java | 1 - .../sdc/be/servlets/ConfigMgrServletTest.java | 2 - .../sdc/be/servlets/ConfigServletTest.java | 1 - .../sdc/be/servlets/ConsumerServletTest.java | 1 - .../sdc/be/servlets/CsarBuildServletTest.java | 6 - .../servlets/DistributionServiceServletTest.java | 1 - .../sdc/be/servlets/ElementServletTest.java | 1 - .../sdc/be/servlets/GroupServletTest.java | 1 - .../sdc/be/servlets/InputsServletTest.java | 1 - .../sdc/be/servlets/LifecycleServletTest.java | 1 - .../sdc/be/servlets/ProductServletTest.java | 1 - .../sdc/be/servlets/PropertyServletTest.java | 3 - .../sdc/be/servlets/RepresentationUtilsTest.java | 2 - .../sdc/be/servlets/RequirementsServletTest.java | 1 - .../ResourceArtifactDownloadServletTest.java | 1 - .../sdc/be/servlets/ResourceServletTest.java | 1 - .../sdc/be/servlets/ResourceUploadServletTest.java | 5 +- .../sdc/be/servlets/ResourcesServletTest.java | 2 - .../sdc/be/servlets/ServiceServletTest.java | 1 - .../sdc/be/servlets/TypesFetchServletTest.java | 1 - .../sdc/be/servlets/TypesUploadServletTest.java | 6 - .../sdc/be/servlets/UserAdminServletTest.java | 1 - .../detector/SwitchoverDetectorTest.java | 2 - .../openecomp/sdc/be/tosca/ArtifactTypesTest.java | 2 - .../org/openecomp/sdc/be/tosca/CsarUtilsTest.java | 3 - .../sdc/be/tosca/PropertyConvertorTest.java | 34 +- .../org/openecomp/sdc/be/tosca/SchemaFiles.java | 3 +- .../sdc/be/tosca/ToscaExportHandlerTest.java | 2 - .../sdc/be/tosca/ToscaExportUtilsTest.java | 124 + .../sdc/be/tosca/ToscaRepresentationTest.java | 2 - .../org/openecomp/sdc/be/tosca/ToscaUtilsTest.java | 2 - .../sdc/be/tosca/model/EntrySchemaTest.java | 2 - .../be/tosca/model/SubstitutionMappingTest.java | 2 - .../sdc/be/tosca/model/ToscaCapabilityTest.java | 2 - .../sdc/be/tosca/model/ToscaGroupTemplateTest.java | 2 - .../sdc/be/tosca/model/ToscaMetadataTest.java | 2 - .../sdc/be/tosca/model/ToscaNodeTemplateTest.java | 2 - .../sdc/be/tosca/model/ToscaNodeTypeTest.java | 2 - .../sdc/be/tosca/model/ToscaPropertyTest.java | 2 - .../sdc/be/tosca/model/ToscaRequirementTest.java | 2 - .../tosca/model/ToscaTemplateCapabilityTest.java | 2 - .../tosca/model/ToscaTemplateRequirementTest.java | 2 - .../sdc/be/tosca/model/ToscaTemplateTest.java | 2 - .../be/tosca/model/ToscaTopolgyTemplateTest.java | 2 - .../be/tosca/model/VfModuleToscaMetadataTest.java | 2 - .../transaction/mngr/RollbackManagerTest.java | 2 - .../transaction/mngr/SdncTransactionTest.java | 2 - .../transaction/mngr/TransactionManagerTest.java | 2 - .../resources/config/catalog-be/configuration.yaml | 20 +- .../csarComparer/vmmeDifferentName.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeDifferentRelationship.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeDifferentRequirementName.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeDifferentRequirementNode.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeDifferentType.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeLessInstances.yaml | 3509 ++++++++++++++++ .../csarComparer/vmmeLessRequirements.yaml | 3581 ++++++++++++++++ .../yamlValidation/csarComparer/vmmeOrig.yaml | 3585 ++++++++++++++++ .../vmmeReuirementWithDifferentCapability.yaml | 3585 ++++++++++++++++ .../csarComparer/vmmeWithMissingRelationship.yaml | 3584 ++++++++++++++++ catalog-dao/.gitignore | 1 - catalog-dao/pom.xml | 8 +- .../org/openecomp/sdc/be/dao/api/ActionStatus.java | 2 +- .../sdc/be/dao/cassandra/ArtifactAccessor.java | 2 - .../sdc/be/dao/cassandra/ArtifactCassandraDao.java | 2 +- .../sdc/be/dao/cassandra/CassandraClient.java | 6 +- .../sdc/be/dao/cassandra/CassandraDao.java | 9 +- .../be/dao/cassandra/schema/SdcSchemaBuilder.java | 24 +- .../be/dao/cassandra/schema/SdcSchemaUtils.java | 6 +- .../sdc/be/dao/cassandra/schema/Table.java | 20 +- .../tables/CategoryEventTableDescription.java | 2 - .../tables/ComponentCacheTableDescription.java | 7 +- .../tables/ConsumerEventTableDefinition.java | 1 - .../schema/tables/DistribDeployEventTableDesc.java | 1 - .../schema/tables/DistribStatusEventTableDesc.java | 1 - .../schema/tables/ExternalApiEventTableDesc.java | 1 + .../schema/tables/GetCatHierEventTableDesc.java | 1 - .../schema/tables/GetUebClusterEventTableDesc.java | 1 - .../schema/tables/GetUsersListEventTableDesc.java | 1 - .../tables/MigrationTasksTableDescription.java | 13 +- .../tables/OldExternalApiEventTableDesc.java | 1 + .../tables/ResAdminEventTableDescription.java | 2 - .../tables/UserAdminEventTableDescription.java | 1 - .../sdc/be/dao/graph/datatype/GraphEdge.java | 2 - .../openecomp/sdc/be/dao/impl/ESTimeBasedDao.java | 2 +- .../sdc/be/dao/jsongraph/GraphVertex.java | 1 - .../sdc/be/dao/jsongraph/types/VertexTypeEnum.java | 15 +- .../sdc/be/dao/jsongraph/utils/IdBuilderUtils.java | 1 + .../dao/neo4j/GraphEdgePropertiesDictionary.java | 2 - .../openecomp/sdc/be/dao/rest/HttpRestClient.java | 1 - .../sdc/be/dao/titan/TitanGenericDao.java | 4 - .../sdc/be/dao/titan/TitanGraphClient.java | 15 - .../org/openecomp/sdc/be/dao/utils/MapUtil.java | 38 + .../sdc/be/resources/api/IResourceUploader.java | 5 - .../sdc/be/resources/data/CapabilityInstData.java | 1 - .../be/resources/data/ComponentMetadataData.java | 2 - .../sdc/be/resources/data/GroupInstanceData.java | 2 - .../sdc/be/resources/data/MigrationTaskEntry.java | 5 +- .../be/dao/cassandra/AuditCassandraDaoTest.java | 3 - .../dao/cassandra/ComponentCassandraDaoTest.java | 6 - .../cassandra/SdcSchemaFilesCassandraDaoTest.java | 2 - .../dao/cassandra/schema/SdcSchemaUtilsTest.java | 4 - .../sdc/be/dao/cassandra/schema/TableTest.java | 2 - .../tables/ArtifactTableDescriptionTest.java | 2 - .../tables/AuthEventTableDescriptionTest.java | 2 - .../tables/CategoryEventTableDescriptionTest.java | 3 - .../tables/ComponentCacheTableDescriptionTest.java | 2 - .../tables/ConsumerEventTableDefinitionTest.java | 2 - .../tables/DistribDeployEventTableDescTest.java | 2 - .../tables/DistribDownloadEventTableDescTest.java | 2 - .../tables/DistribEngineEventTableDescTest.java | 2 - .../tables/DistribNotifEventTableDescTest.java | 2 - .../tables/DistribStatusEventTableDescTest.java | 3 - .../tables/ExternalApiEventTableDescTest.java | 2 - .../tables/GetCatHierEventTableDescTest.java | 2 - .../tables/GetUebClusterEventTableDescTest.java | 2 - .../tables/GetUsersListEventTableDescTest.java | 2 - .../tables/MigrationTasksTableDescriptionTest.java | 2 - .../tables/OldExternalApiEventTableDescTest.java | 2 - .../tables/ResAdminEventTableDescriptionTest.java | 3 - .../tables/SdcSchemaFilesTableDescriptionTest.java | 2 - .../UserAccessEventTableDescriptionTest.java | 2 - .../tables/UserAdminEventTableDescriptionTest.java | 3 - .../sdc/be/dao/jsongraph/GraphVertexTest.java | 3 - .../sdc/be/dao/jsongraph/TitanDaoTest.java | 9 - .../be/dao/jsongraph/types/EdgeLabelEnumTest.java | 2 - .../dao/jsongraph/types/EdgePropertyEnumTest.java | 2 - .../be/dao/jsongraph/types/VertexTypeEnumTest.java | 2 - .../sdc/be/dao/model/FacetedSearchFacetTest.java | 2 - .../sdc/be/dao/rest/RestConfigurationInfoTest.java | 2 - .../openecomp/sdc/be/dao/utils/MapEntryTest.java | 2 - .../sdc/be/resources/AuditingDaoTest.java | 31 +- .../openecomp/sdc/be/resources/CassandraTest.java | 8 +- .../sdc/be/resources/JsonParserUtilsTests.java | 3 - .../sdc/be/resources/TitanGenericDaoTest.java | 3 - .../data/AdditionalInfoParameterDataTest.java | 2 - .../sdc/be/resources/data/ArtifactDataTest.java | 2 - .../sdc/be/resources/data/AttributeDataTest.java | 2 - .../be/resources/data/AttributeValueDataTest.java | 2 - .../sdc/be/resources/data/CapabilityDataTest.java | 2 - .../be/resources/data/CapabilityInstDataTest.java | 2 - .../be/resources/data/CapabilityTypeDataTest.java | 2 - .../be/resources/data/ComponentCacheDataTest.java | 2 - .../resources/data/ComponentInstanceDataTest.java | 2 - .../sdc/be/resources/data/ConsumerDataTest.java | 2 - .../sdc/be/resources/data/DataTypeDataTest.java | 2 - .../sdc/be/resources/data/GroupDataTest.java | 2 - .../be/resources/data/GroupInstanceDataTest.java | 2 - .../sdc/be/resources/data/GroupTypeDataTest.java | 2 - .../be/resources/data/HeatParameterDataTest.java | 3 - .../resources/data/HeatParameterValueDataTest.java | 2 - .../sdc/be/resources/data/InputValueDataTest.java | 2 - .../sdc/be/resources/data/InputsDataTest.java | 2 - .../sdc/be/resources/data/InterfaceDataTest.java | 2 - .../be/resources/data/MigrationTaskEntryTest.java | 2 - .../sdc/be/resources/data/OperationDataTest.java | 2 - .../sdc/be/resources/data/PolicyTypeDataTest.java | 2 - .../be/resources/data/ProductMetadataDataTest.java | 2 - .../sdc/be/resources/data/PropertyDataTest.java | 2 - .../be/resources/data/PropertyValueDataTest.java | 2 - .../resources/data/RelationshipInstDataTest.java | 2 - .../resources/data/RelationshipTypeDataTest.java | 2 - .../sdc/be/resources/data/RequirementDataTest.java | 2 - .../be/resources/data/RequirementImplDataTest.java | 2 - .../resources/data/ResourceCategoryDataTest.java | 2 - .../be/resources/data/SdcSchemaFilesDataTest.java | 2 - .../data/ServiceArtifactsDataCollectionTest.java | 2 - .../be/resources/data/ServiceMetadataDataTest.java | 2 - .../sdc/be/resources/data/UserDataTest.java | 2 - .../resources/data/UserFunctionalMenuDataTest.java | 2 - .../resources/data/auditing/ConsumerEventTest.java | 2 - .../data/auditing/DistributionDeployEventTest.java | 2 - .../auditing/DistributionDownloadEventTest.java | 2 - .../data/auditing/DistributionEngineEventTest.java | 2 - .../DistributionNotificationEventTest.java | 2 - .../data/auditing/DistributionStatusEventTest.java | 2 - .../data/auditing/ExternalApiEventTest.java | 2 - .../auditing/GetCategoryHierarchyEventTest.java | 2 - .../data/auditing/GetUsersListEventTest.java | 2 - .../data/auditing/ResourceAdminEventTest.java | 2 - .../data/auditing/UserAccessEventTest.java | 2 - .../data/auditing/UserAdminEventTest.java | 2 - .../exception/ResourceDAOExceptionTest.java | 2 - catalog-fe/pom.xml | 3 +- .../org/openecomp/sdc/fe/impl/HttpRequestInfo.java | 3 - .../sdc/fe/servlets/HealthCheckService.java | 131 +- .../src/main/resources/config/configuration.yaml | 6 + .../java/org/openecomp/sdc/fe/GzipFilterTest.java | 4 - .../openecomp/sdc/fe/client/BackendClientTest.java | 8 - .../sdc/fe/listen/MyObjectMapperProviderTest.java | 2 - .../sdc/fe/servlets/PortalServletTest.java | 6 - catalog-model/.gitignore | 2 - catalog-model/pom.xml | 8 +- .../sdc/be/model/CapabilityDefinition.java | 4 +- .../model/CapabilityRequirementRelationship.java | 39 + .../java/org/openecomp/sdc/be/model/Component.java | 59 + .../openecomp/sdc/be/model/ComponentInstance.java | 17 + .../sdc/be/model/ComponentInstancePropInput.java | 1 - .../openecomp/sdc/be/model/DataTypeDefinition.java | 2 - .../sdc/be/model/DerivedNodeTypeResolver.java | 7 +- .../org/openecomp/sdc/be/model/GroupInstance.java | 1 + .../org/openecomp/sdc/be/model/GroupProperty.java | 1 - .../sdc/be/model/ImplementationArtifact.java | 2 + .../sdc/be/model/InterfaceDefinition.java | 2 - .../openecomp/sdc/be/model/PropertyDefinition.java | 1 + .../sdc/be/model/PropertyValueDefinition.java | 1 - ...RelationshipPair.java => RelationshipInfo.java} | 24 +- .../java/org/openecomp/sdc/be/model/Resource.java | 13 +- .../java/org/openecomp/sdc/be/model/Service.java | 9 +- .../sdc/be/model/TargetCapabilityRelDef.java | 15 +- .../org/openecomp/sdc/be/model/UploadPropInfo.java | 1 - .../org/openecomp/sdc/be/model/UploadReqInfo.java | 2 - .../sdc/be/model/cache/ComponentCache.java | 5 +- .../sdc/be/model/cache/jobs/CheckAndUpdateJob.java | 5 +- .../sdc/be/model/cache/jobs/DeleteJob.java | 4 - .../org/openecomp/sdc/be/model/cache/jobs/Job.java | 4 +- .../sdc/be/model/cache/jobs/OverrideJob.java | 4 +- .../sdc/be/model/cache/workers/CacheWorker.java | 7 +- .../sdc/be/model/cache/workers/SyncWorker.java | 9 +- .../sdc/be/model/heat/HeatParameterType.java | 2 - .../jsontitan/operations/ArtifactsOperations.java | 18 +- .../model/jsontitan/operations/BaseOperation.java | 4 +- .../ByToscaNameDerivedNodeTypeResolver.java | 9 +- .../jsontitan/operations/GroupsOperation.java | 13 +- .../operations/NodeTemplateOperation.java | 438 +- .../jsontitan/operations/NodeTypeOperation.java | 108 +- .../operations/TopologyTemplateOperation.java | 69 +- .../operations/ToscaElementOperation.java | 20 +- .../jsontitan/operations/ToscaOperationFacade.java | 4277 ++++++++++---------- .../be/model/jsontitan/utils/ModelConverter.java | 119 +- .../api/IAdditionalInformationOperation.java | 1 - .../model/operations/api/IArtifactOperation.java | 4 - .../operations/api/ICacheMangerOperation.java | 3 - .../model/operations/api/ICapabilityOperation.java | 8 - .../api/IComponentInstanceOperation.java | 14 - .../model/operations/api/IConsumerOperation.java | 4 +- .../operations/api/IGroupInstanceOperation.java | 13 - .../be/model/operations/api/IGroupOperation.java | 2 - .../be/model/operations/api/IInputsOperation.java | 6 - .../api/IInterfaceLifecycleOperation.java | 3 - .../model/operations/api/IUserAdminOperation.java | 3 - .../model/operations/impl/ArtifactOperation.java | 1 - .../operations/impl/CacheMangerOperation.java | 25 +- .../model/operations/impl/CapabilityOperation.java | 23 - .../impl/ComponentInstanceOperation.java | 16 +- .../model/operations/impl/ConsumerOperation.java | 6 +- .../be/model/operations/impl/CsarOperation.java | 40 + .../be/model/operations/impl/ElementOperation.java | 2 +- .../operations/impl/GroupInstanceOperation.java | 27 +- .../be/model/operations/impl/GroupOperation.java | 13 - .../operations/impl/HeatParametersOperation.java | 2 - .../be/model/operations/impl/InputsOperation.java | 38 - .../impl/InterfaceLifecycleOperation.java | 1 - .../be/model/operations/impl/OnboardingClient.java | 38 +- .../model/operations/impl/UserAdminOperation.java | 21 +- .../operations/utils/ComponentValidationUtils.java | 3 +- .../exception/ConstraintFunctionalException.java | 1 - .../ConstraintRequiredParameterException.java | 1 - ...traintValueDoNotMatchPropertyTypeException.java | 1 - .../exception/ConstraintViolationException.java | 1 - .../converters/DataTypePropertyConverter.java | 17 +- .../be/model/tosca/converters/JsonConverter.java | 1 - .../tosca/converters/ToscaConverterUtils.java | 4 +- .../validators/DataTypeValidatorConverter.java | 1 - .../be/model/tosca/validators/JsonValidator.java | 7 - .../be/model/tosca/validators/StringValidator.java | 2 +- .../sdc/be/ui/model/UiComponentDataTransfer.java | 3 - .../sdc/be/ui/model/UiComponentMetadata.java | 1 - .../sdc/be/ui/model/UiResourceMetadata.java | 1 + .../sdc/be/ui/model/UiServiceMetadata.java | 5 + .../model/AdditionalInformationDefinitionTest.java | 4 - .../sdc/be/model/ArtifactDefinitionTest.java | 2 - .../sdc/be/model/ArtifactUiDownloadDataTest.java | 2 - .../org/openecomp/sdc/be/model/CapReqDefTest.java | 2 - .../sdc/be/model/CapabilityDefinitionTest.java | 4 - .../sdc/be/model/CapabilityTypeDefinitionTest.java | 2 - .../sdc/be/model/ComponentInstInputsMapTest.java | 2 - .../sdc/be/model/ComponentInstanceInputTest.java | 2 - .../be/model/ComponentInstancePropInputTest.java | 2 - .../be/model/ComponentInstancePropertyTest.java | 2 - .../be/model/ComponentMetadataDefinitionTest.java | 2 - .../org/openecomp/sdc/be/model/CsarInfoTest.java | 2 - .../sdc/be/model/DataTypeDefinitionTest.java | 4 - .../sdc/be/model/FunctionalMenuInfoTest.java | 2 - .../sdc/be/model/GroupDefinitionTest.java | 2 - .../openecomp/sdc/be/model/GroupPropertyTest.java | 2 - .../sdc/be/model/GroupTypeDefinitionTest.java | 4 - .../sdc/be/model/InputDefinitionTest.java | 2 - .../sdc/be/model/InterfaceDefinitionTest.java | 2 - .../openecomp/sdc/be/model/NodeTypeInfoTest.java | 2 - .../java/org/openecomp/sdc/be/model/PointTest.java | 2 - .../sdc/be/model/PolicyTypeDefinitionTest.java | 2 - .../org/openecomp/sdc/be/model/ProductTest.java | 3 - .../sdc/be/model/PropertyDefinitionTest.java | 2 - .../model/RequirementAndRelationshipPairTest.java | 216 - .../sdc/be/model/RequirementImplDefTest.java | 2 - .../sdc/be/model/RequirementInstanceTest.java | 2 - .../model/ResourceInstanceHeatParameterTest.java | 2 - .../openecomp/sdc/be/model/UploadCapInfoTest.java | 2 - .../openecomp/sdc/be/model/UploadPropInfoTest.java | 2 - .../openecomp/sdc/be/model/UploadReqInfoTest.java | 2 - .../openecomp/sdc/be/model/cache/DaoInfoTest.java | 2 - .../be/model/category/CategoryDefinitionTest.java | 4 - .../model/category/SubCategoryDefinitionTest.java | 2 - .../be/model/jsontitan/datamodel/NodeTypeTest.java | 2 - .../jsontitan/datamodel/TopologyTemplateTest.java | 2 - .../datamodel/ToscaElementTypeEnumTest.java | 3 - .../jsontitan/enums/JsonConstantKeysEnumTest.java | 2 - .../operations/ArtifactsOperationsTest.java | 23 +- .../operations/NodeTemplateOperationTest.java | 194 + .../operations/ToscaElementOperationTestImpl.java | 3 +- .../operations/ToscaOperationFacadeTest.java | 21 +- .../be/model/jsontitan/utils/GraphTestUtils.java | 22 +- .../impl/AdditionalInformationOperationTest.java | 4 +- .../operations/impl/ArtifactOperationTest.java | 18 +- .../impl/CapabilityTypeOperationTest.java | 5 - .../operations/impl/ElementOperationTest.java | 1 - .../impl/HeatParametersOperationTest.java | 51 +- .../operations/impl/InterfaceOperationTest.java | 7 +- .../operations/impl/PolicyTypeOperationTest.java | 1 - .../operations/impl/PropertyOperationTest.java | 19 +- .../impl/ToscaElementLifecycleOperationTest.java | 5 +- .../operations/impl/UserAdminOperationTest.java | 23 +- .../impl/util/DataTypeValidatorTest.java | 15 +- .../be/model/operations/impl/util/PrintGraph.java | 1 - .../model/serialize/TestResourceSerialization.java | 2 - .../sdc/be/model/tosca/ToscaTypeTest.java | 2 - .../tosca/constraints/EqualConstraintTest.java | 3 - .../constraints/GreaterThanConstraintTest.java | 3 - .../tosca/constraints/InRangeConstraintTest.java | 3 - .../tosca/constraints/LengthConstraintTest.java | 2 - .../constraints/LessOrEqualConstraintTest.java | 3 - .../tosca/constraints/MaxLengthConstraintTest.java | 2 - .../tosca/constraints/MinLengthConstraintTest.java | 2 - .../tosca/constraints/PatternConstraintTest.java | 2 - .../constraints/ValidValuesConstraintTest.java | 3 - .../tosca/converters/BooleanConverterTest.java | 2 - .../converters/DataTypePropertyConverterTest.java | 16 +- .../tosca/converters/DefaultConverterTest.java | 2 - .../model/tosca/converters/FloatConverterTest.java | 5 - .../tosca/converters/HeatBooleanConverterTest.java | 6 - .../HeatCommaDelimitedListConverterTest.java | 6 - .../tosca/converters/HeatJsonConverterTest.java | 6 - .../tosca/converters/HeatNumberConverterTest.java | 6 - .../tosca/converters/HeatStringConverterTest.java | 4 - .../tosca/converters/IntegerConverterTest.java | 2 - .../model/tosca/converters/JsonConverterTest.java | 2 - .../model/tosca/converters/ListConverterTest.java | 8 - .../model/tosca/converters/MapConverterTest.java | 5 - .../tosca/converters/StringConvertorTest.java | 6 - .../converters/ToscaBooleanConverterTest.java | 6 - .../tosca/converters/ToscaFloatConverterTest.java | 6 - .../converters/ToscaJsonValueConverterTest.java | 2 - .../converters/ToscaListValueConverterTest.java | 6 - .../tosca/converters/ToscaStringConvertorTest.java | 2 - .../converters/ToscaValueDefaultConverterTest.java | 2 - .../tosca/validators/IntegerValidatorTest.java | 7 +- .../model/tosca/version/ComparableVersionTest.java | 2 - .../sdc/be/model/tosca/version/VersionTest.java | 4 - .../sdc/be/ui/model/UiCategoriesTest.java | 2 - .../be/ui/model/UiComponentDataTransferTest.java | 2 - .../be/ui/model/UiResourceDataTransferTest.java | 2 - .../sdc/be/ui/model/UiResourceMetadataTest.java | 2 - .../sdc/be/ui/model/UiServiceDataTransferTest.java | 2 - .../sdc/be/ui/model/UiServiceMetadataTest.java | 2 - catalog-ui/configurations/dev.js | 2 +- catalog-ui/configurations/prod.js | 2 +- catalog-ui/package.json | 2 +- catalog-ui/src/app/app.ts | 42 +- .../requirement/requirements-list-directive.ts | 11 +- .../app/directives/ecomp-footer/ecomp-footer.html | 8 - .../app/directives/ecomp-footer/ecomp-footer.less | 47 - .../app/directives/ecomp-footer/ecomp-footer.ts | 53 - .../app/directives/ecomp-header/ecomp-header.ts | 21 +- .../graphs-v2/common/common-graph-utils.ts | 44 +- .../style/component-instances-nodes-style.ts | 17 + .../composition-graph.directive.ts | 230 +- .../composition-graph/composition-graph.html | 12 +- .../utils/composition-graph-general-utils.ts | 14 +- .../utils/composition-graph-links-utils.ts | 47 +- .../utils/match-capability-requierment-utils.ts | 238 +- .../deployment-graph/deployment-graph.directive.ts | 6 +- .../graphs-v2/palette/palette.directive.ts | 45 +- .../app/directives/graphs-v2/palette/palette.html | 2 +- .../graphs-v2/relation-menu/relation-menu.html | 48 +- .../graphs-v2/relation-menu/relation-menu.ts | 16 +- .../src/app/directives/layout/top-nav/top-nav.html | 54 - .../src/app/directives/layout/top-nav/top-nav.less | 218 - .../src/app/directives/layout/top-nav/top-nav.ts | 161 - .../src/app/directives/loader/loader-directive.ts | 21 +- .../data-type-fields-structure.html | 4 +- .../data-type-fields-structure.less | 4 + .../type-map/type-map-directive.html | 4 +- .../type-map/type-map-directive.less | 5 + .../select-data-type-fields-structure.less | 10 +- .../user-header-details-directive.ts | 26 +- catalog-ui/src/app/models.ts | 7 +- catalog-ui/src/app/models/capability.ts | 18 +- catalog-ui/src/app/models/components/component.ts | 70 +- .../componentsInstances/componentInstance.ts | 40 +- .../componentsInstances/serviceProxyInstance.ts | 35 + ...ationMenuObjects.ts => connectRelationModel.ts} | 35 +- .../composition-ci-ucpe-link.ts | 2 +- .../app/models/graph/graph-links/links-factory.ts | 4 +- catalog-ui/src/app/models/graph/match-relation.ts | 68 +- .../composition-ci-node-base.ts | 7 +- .../composition-ci-node-configuration.ts} | 40 +- .../composition-ci-node-cp.ts | 3 +- .../composition-ci-node-service-proxy.ts | 42 + .../composition-ci-node-service.ts | 2 +- .../composition-ci-node-ucpe-cp.ts | 2 + .../composition-ci-node-ucpe.ts | 2 + .../composition-ci-node-vf.ts | 3 +- .../composition-ci-node-vfc.ts | 3 +- .../composition-ci-node-vl.ts | 1 + .../nodes/modules-graph-nodes/module-node-base.ts | 3 +- .../src/app/models/graph/nodes/nodes-factory.ts | 10 +- catalog-ui/src/app/models/graph/relationship.ts | 48 +- catalog-ui/src/app/models/heat-parameters.ts | 1 + .../models/properties-inputs/property-be-model.ts | 2 +- .../models/properties-inputs/property-fe-model.ts | 1 + catalog-ui/src/app/models/properties.ts | 15 +- catalog-ui/src/app/models/radio-button.ts | 11 + catalog-ui/src/app/models/requirement.ts | 16 +- catalog-ui/src/app/models/user.ts | 29 +- catalog-ui/src/app/models/wizard-step.ts | 19 + catalog-ui/src/app/modules/directive-module.ts | 19 +- catalog-ui/src/app/modules/service-module.ts | 17 +- catalog-ui/src/app/ng2/app.module.ts | 33 +- .../menu-list-ng2/menu-list-ng2.component.html | 7 + .../menu-list-ng2/menu-list-ng2.component.ts | 36 + .../menu-list-ng2/menu-list-ng2.module.ts | 23 + .../dynamic-element/dynamic-element.module.ts | 56 - .../checkbox/ui-element-checkbox.component.html | 1 - .../checkbox/ui-element-checkbox.component.less | 2 - .../dropdown/ui-element-dropdown.component.html | 3 - .../src/app/ng2/components/layout/layout.module.ts | 24 + .../layout/top-nav/top-nav.component.html | 53 + .../layout/top-nav/top-nav.component.less | 225 + .../components/layout/top-nav/top-nav.component.ts | 149 + .../filter-properties-assignment.component.html | 5 +- .../filter-properties-assignment.component.less | 2 +- .../filter-properties-assignment.component.ts | 4 +- .../hierarchy-display-options.ts | 0 .../hierarchy-navigation.component.html | 2 +- .../hierarchy-navigation.component.less | 0 .../hierarchy-navigation.component.ts | 0 .../inputs-table/inputs-table.component.html | 2 +- .../inputs-table/inputs-table.component.less | 2 +- .../inputs-table/inputs-table.component.ts | 8 +- .../dynamic-property.component.html | 7 +- .../dynamic-property.component.less | 12 +- .../dynamic-property/dynamic-property.component.ts | 9 +- .../pipes/filterChildProperties.pipe.ts | 0 .../properties-table.component.html | 22 +- .../properties-table.component.less | 20 +- .../properties-table/properties-table.component.ts | 23 +- .../properties-table/property-table.module.ts | 29 + ...select-reqiurement-or-capability.component.less | 77 + ...select-requirement-or-capability.component.html | 36 + .../select-requirement-or-capability.component.ts | 182 + .../select-requirement-or-capability.module.ts | 24 + .../app/ng2/components/modal/modal.component.less | 128 - .../dynamic-element/dynamic-element.component.less | 0 .../dynamic-element/dynamic-element.component.ts | 47 +- .../ui/dynamic-element/dynamic-element.module.ts | 43 + .../checkbox/checkbox.component.html | 0 .../checkbox/checkbox.component.less | 4 +- .../checkbox/checkbox.component.ts | 0 .../form-components}/checkbox/checkbox.module.ts | 0 .../dropdown/ui-element-dropdown.component.html | 3 + .../dropdown/ui-element-dropdown.component.less | 0 .../dropdown/ui-element-dropdown.component.ts | 13 +- .../ui/form-components/form-elements.module.ts | 42 + .../input/ui-element-input.component.html | 3 +- .../input/ui-element-input.component.less | 0 .../input/ui-element-input.component.ts | 0 .../ui-element-integer-input.component.html | 3 +- .../ui-element-integer-input.component.less | 0 .../ui-element-integer-input.component.ts | 2 +- .../ui-element-popover-input.component.html | 0 .../ui-element-popover-input.component.less | 0 .../ui-element-popover-input.component.ts | 5 +- .../radio-buttons/radio-button.component.less | 42 + .../radio-buttons/radio-buttons.component.html | 8 + .../radio-buttons/radio-buttons.component.ts | 29 + .../form-components}/ui-element-base.component.ts | 10 +- .../{ => ui}/loader/loader.component.html | 0 .../{ => ui}/loader/loader.component.less | 2 +- .../components/{ => ui}/loader/loader.component.ts | 0 .../components/ui/menu/menu-item.component.html | 3 + .../components/ui/menu/menu-item.component.less | 13 + .../ng2/components/ui/menu/menu-item.component.ts | 44 + .../components/ui/menu/menu-list.component.html | 9 + .../components/ui/menu/menu-list.component.less | 13 + .../ng2/components/ui/menu/menu-list.component.ts | 70 + .../app/ng2/components/ui/menu/menu-list.module.ts | 27 + .../error-message/error-message.component.html | 0 .../modal/error-message/error-message.component.ts | 0 .../components/{ => ui}/modal/modal.component.html | 1 + .../ng2/components/ui/modal/modal.component.less | 129 + .../components/{ => ui}/modal/modal.component.ts | 0 .../ng2/components/{ => ui}/modal/modal.module.ts | 4 +- .../multi-steps-wizard-header-base.component.ts | 10 + .../multi-steps-wizard.component.html | 57 + .../multi-steps-wizard.component.less | 90 + .../multi-steps-wizard.component.ts | 78 + .../multi-steps-wizard.module.ts | 22 + .../ui}/navbar/navbar-routes.config.ts | 0 .../ui}/navbar/navbar.component.html | 0 .../ui}/navbar/navbar.component.less | 0 .../ui}/navbar/navbar.component.ts | 0 .../ui}/navbar/navbar.metadata.ts | 0 .../ui}/navbar/navbar.module.ts | 0 .../popover/popover-content.component.html | 0 .../popover/popover-content.component.less | 6 +- .../{ => ui}/popover/popover-content.component.ts | 0 .../{ => ui}/popover/popover.component.ts | 0 .../components/{ => ui}/popover/popover.module.ts | 2 - .../ui}/search-bar/search-bar.component.html | 0 .../ui}/search-bar/search-bar.component.less | 3 +- .../ui}/search-bar/search-bar.component.ts | 0 .../search-with-autocomplete.component.html | 0 .../search-with-autocomplete.component.less | 3 +- .../search-with-autocomplete.component.ts | 0 .../ui}/tabs/tab/tab.component.ts | 0 .../ui}/tabs/tabs.component.html | 2 +- .../ui}/tabs/tabs.component.less | 3 +- .../ui}/tabs/tabs.component.ts | 0 .../{shared => components/ui}/tabs/tabs.module.ts | 2 +- .../tooltip/tooltip-content.component.html | 0 .../tooltip/tooltip-content.component.less | 0 .../{ => ui}/tooltip/tooltip-content.component.ts | 0 .../{ => ui}/tooltip/tooltip.component.ts | 0 .../components/{ => ui}/tooltip/tooltip.module.ts | 1 - .../app/ng2/components/ui/ui-elements.module.ts | 80 + .../app/ng2/config/sdc-config.config.factory.ts | 17 + catalog-ui/src/app/ng2/config/sdc-config.config.ts | 11 + .../config/translation.service.config.factory.ts | 13 + .../app/ng2/config/translation.service.config.ts | 8 + .../connection-properties-view.component.html | 4 + .../connection-properties-view.component.less | 4 + .../connection-properties-view.component.ts | 10 + .../connection-wizard-header.component.html | 36 + .../connection-wizard-header.component.less | 53 + .../connection-wizard-header.component.ts | 37 + .../connection-wizard/connection-wizard.module.ts | 43 + .../connection-wizard/connection-wizard.service.ts | 67 + .../from-node-step/from-node-step.component.html | 8 + .../from-node-step/from-node-step.component.ts | 49 + .../properties-step/properties-step.component.html | 13 + .../properties-step/properties-step.component.less | 15 + .../properties-step/properties-step.component.ts | 67 + .../to-node-step/to-node-step.component.html | 9 + .../to-node-step/to-node-step.component.ts | 69 + .../properties-assignment.module.ts | 69 +- .../properties-assignment.page.component.html | 9 +- .../properties-assignment.page.component.ts | 17 +- .../services/hierarchy-nav.service.ts | 0 .../{ => services}/properties.utils.ts | 17 +- .../src/app/ng2/pipes/global-pipes.module.ts | 24 + .../src/app/ng2/services/authentication.service.ts | 13 +- .../component-instance.service.ts | 35 +- .../component-mode.service.ts | 2 +- .../component-services/component.service.ts | 19 +- .../services/component-services/service.service.ts | 10 +- catalog-ui/src/app/ng2/services/config.service.ts | 12 +- catalog-ui/src/app/ng2/services/cookie.service.ts | 8 +- catalog-ui/src/app/ng2/services/http.service.ts | 14 +- catalog-ui/src/app/ng2/services/modal.service.ts | 41 +- .../src/app/ng2/services/properties.service.ts | 8 +- catalog-ui/src/app/ng2/services/user.service.ts | 98 + .../translate.module.ts} | 28 +- .../app/ng2/shared/translator/translate.pipe.ts | 62 + .../shared/translator/translate.service.config.ts | 30 + .../app/ng2/shared/translator/translate.service.ts | 235 ++ .../src/app/ng2/utils/ng1-upgraded-provider.ts | 10 + catalog-ui/src/app/services.ts | 1 - .../app/services/components/component-service.ts | 28 +- catalog-ui/src/app/services/entity-service.ts | 3 +- catalog-ui/src/app/services/loader-service.ts | 8 +- .../src/app/services/user-resource-service.ts | 123 - catalog-ui/src/app/utils/component-factory.ts | 19 +- .../src/app/utils/component-instance-factory.ts | 18 +- catalog-ui/src/app/utils/constants.ts | 5 + catalog-ui/src/app/utils/menu-handler.ts | 6 +- .../admin-dashboard/admin-dashboard-view.html | 1 - .../user-management/user-management-view-model.ts | 39 +- .../user-management/user-management-view.html | 4 +- .../app/view-models/catalog/catalog-view-model.ts | 11 +- .../src/app/view-models/catalog/catalog-view.html | 30 +- .../view-models/dashboard/dashboard-view-model.ts | 9 +- .../app/view-models/dashboard/dashboard-view.html | 28 +- .../app/view-models/dcae-app/dcae-app-view.html | 2 +- .../env-parameters-form/env-parameters-form.html | 5 +- .../env-parameters-form/env-parameters-form.less | 4 +- .../env-parameters-form/env-parameters-form.ts | 19 +- .../property-form-view-model.ts | 3 +- .../onboarding-modal-view-model.ts | 1 + .../onboard-vendor/onboard-vendor-view.html | 3 +- .../tabs/composition/composition-view-model.ts | 16 +- .../tabs/composition/composition-view.html | 11 +- .../workspace/tabs/composition/composition.less | 111 +- .../tabs/artifacts/artifacts-view-model.ts | 10 +- .../composition/tabs/artifacts/artifacts-view.html | 7 +- .../composition/tabs/details/details-view.html | 11 +- .../tabs/composition/tabs/details/details.less | 2 +- .../workspace/tabs/general/general-view-model.ts | 26 + .../workspace/tabs/general/general-view.html | 32 +- .../tabs/properties/properties-view-model.ts | 3 +- .../view-models/workspace/workspace-view-model.ts | 2 +- .../app/view-models/workspace/workspace-view.html | 10 +- .../src/app/view-models/workspace/workspace.less | 6 +- catalog-ui/src/assets/languages/en_US.json | 5 +- catalog-ui/src/assets/styles/app.less | 2 - .../images/resource-icons/dcae_machineLearning.png | Bin 0 -> 3710 bytes .../styles/images/resource-icons/networkrules.png | Bin 2920 -> 2907 bytes .../assets/styles/images/resource-icons/pmc.png | Bin 0 -> 1453 bytes .../styles/images/resource-icons/securityrules.png | Bin 2965 -> 2980 bytes .../images/service-proxy-icons/call_controll.png | Bin 0 -> 3929 bytes .../images/service-proxy-icons/collaboration.png | Bin 0 -> 4443 bytes .../styles/images/service-proxy-icons/compute.png | Bin 0 -> 3834 bytes .../images/service-proxy-icons/defaulticon.png | Bin 0 -> 2879 bytes .../images/service-proxy-icons/messaging.png | Bin 0 -> 3147 bytes .../styles/images/service-proxy-icons/mobility.png | Bin 0 -> 3771 bytes .../images/service-proxy-icons/network_l_1-3.png | Bin 0 -> 3761 bytes .../images/service-proxy-icons/network_l_4.png | Bin 0 -> 3662 bytes .../images/service-proxy-icons/notification.png | Bin 0 -> 3379 bytes .../styles/images/service-proxy-icons/platform.png | Bin 0 -> 4309 bytes .../styles/images/service-proxy-icons/storage.png | Bin 0 -> 3841 bytes .../images/service-proxy-icons/uncertified.png | Bin 0 -> 1503 bytes .../assets/styles/images/sprites/sprite-global.png | Bin 98178 -> 100635 bytes .../images/sprites/sprite-resource-icons.png | Bin 476775 -> 490295 bytes .../images/sprites/sprite-services-icons.png | Bin 127233 -> 154466 bytes catalog-ui/src/assets/styles/layout/main.less | 11 +- catalog-ui/src/assets/styles/mixins.less | 2 +- catalog-ui/src/assets/styles/modal.less | 6 +- .../assets/styles/sprite-proxy-services-icons.less | 40 + .../src/assets/styles/sprite-resource-icons.less | 15 +- catalog-ui/src/assets/styles/sprite.less | 11 + catalog-ui/src/assets/styles/tooltips.less | 13 + catalog-ui/src/main.ts | 5 +- catalog-ui/src/tsconfig.json | 3 +- common-app-api/.gitignore | 2 - common-app-api/pom.xml | 8 +- .../org/openecomp/sdc/be/config/Configuration.java | 157 +- .../sdc/be/monitoring/BeMonitoringService.java | 9 +- .../org/openecomp/sdc/common/api/Constants.java | 13 + .../openecomp/sdc/common/api/HealthCheckInfo.java | 24 +- .../sdc/common/config/EcompErrorLogUtil.java | 2 - .../config/generation/GenerateEcompErrorsCsv.java | 2 +- .../sdc/common/listener/AppContextListener.java | 1 - .../openecomp/sdc/common/util/HealthCheckUtil.java | 42 + .../org/openecomp/sdc/common/util/PairUtils.java | 6 +- .../sdc/common/util/YamlToObjectConverter.java | 10 +- .../openecomp/sdc/exception/ResponseFormat.java | 2 - .../org/openecomp/sdc/fe/config/Configuration.java | 54 +- .../sdc/fe/config/FeEcompErrorManager.java | 1 - .../sdc/be/config/BeEcompErrorManagerTest.java | 2 - .../config/CleanComponentsConfigurationTest.java | 2 - .../openecomp/sdc/be/config/ConfigurationTest.java | 2 - .../DistributionEngineConfigurationTest.java | 2 - .../sdc/be/config/ErrorConfigurationTest.java | 2 - .../org/openecomp/sdc/be/config/ErrorInfoTest.java | 2 - .../be/config/Neo4jErrorsConfigurationTest.java | 2 - .../DeploymentArtifactHeatConfigurationTest.java | 2 - .../sdc/common/api/ArtifactGroupTypeEnumTest.java | 2 - .../sdc/common/api/ArtifactTypeEnumTest.java | 2 - .../sdc/common/api/HealthCheckInfoTest.java | 5 +- .../openecomp/sdc/common/api/ResponseInfoTest.java | 2 - .../sdc/common/api/ToscaNodeTypeInfoTest.java | 2 - .../sdc/common/api/ToscaNodeTypeInterfaceTest.java | 2 - .../sdc/common/api/YamlSuffixEnumTest.java | 2 - .../datastructure/AuditingFieldsKeysEnumTest.java | 2 - .../common/datastructure/ESTimeBasedEventTest.java | 2 - .../MonitoringFieldsKeysEnumTest.java | 2 - .../sdc/common/datastructure/WrapperTest.java | 2 - .../sdc/common/kpi/api/ASDCKpiApiTest.java | 2 - .../common/listener/AppContextListenerTest.java | 1 - .../sdc/common/monitoring/MonitoringEventTest.java | 2 - .../common/rest/api/RestConfigurationInfoTest.java | 2 - .../rest/api/RestResponseAsByteArrayTest.java | 4 - .../sdc/common/rest/api/RestResponseTest.java | 2 - .../openecomp/sdc/common/test/CommonUtilsTest.java | 1 - .../sdc/common/test/TestExternalConfiguration.java | 14 +- .../org/openecomp/sdc/common/test/YamlTest.java | 3 +- .../sdc/common/test/config/TestConfiguration.java | 4 +- .../common/util/CapabilityTypeNameEnumTest.java | 2 - .../sdc/common/util/GeneralUtilityTest.java | 2 - .../openecomp/sdc/common/util/GsonFactoryTest.java | 2 - .../sdc/common/util/StreamUtilsTests.java | 1 - .../sdc/common/util/ValidationUtilsTest.java | 2 - .../openecomp/sdc/fe/config/ConfigurationTest.java | 3 - common-be/.gitignore | 1 - common-be/pom.xml | 5 +- .../components/ResourceMetadataDataDefinition.java | 1 - .../components/ServiceMetadataDataDefinition.java | 25 +- .../elements/CapabilityDataDefinition.java | 80 +- .../elements/ComponentInstanceDataDefinition.java | 81 +- .../elements/ListCapabilityDataDefinition.java | 2 - .../be/datatypes/elements/ListDataDefinition.java | 53 +- .../elements/ListMapPropertiesDataDefinition.java | 1 - .../elements/ListRequirementDataDefinition.java | 3 - .../be/datatypes/elements/MapDataDefinition.java | 33 +- .../elements/MapPropertiesDataDefinition.java | 10 + .../elements/ProductMetadataDataDefinition.java | 1 - .../datatypes/elements/PropertyDataDefinition.java | 86 +- .../sdc/be/datatypes/elements/PropertyRule.java | 1 + .../elements/RequirementDataDefinition.java | 50 +- .../be/datatypes/elements/SchemaDefinition.java | 2 - .../be/datatypes/enums/JsonPresentationFields.java | 6 + .../sdc/be/datatypes/enums/OriginTypeEnum.java | 5 +- .../sdc/be/datatypes/enums/ResourceTypeEnum.java | 4 +- .../be/datatypes/tosca/ToscaDataDefinition.java | 67 +- .../java/org/openecomp/sdc/be/workers/Manager.java | 10 +- .../java/org/openecomp/sdc/be/workers/Worker.java | 6 +- .../category/CategoryDataDefinitionTest.java | 2 - .../category/GroupingDataDefinitionTest.java | 2 - .../category/SubCategoryDataDefinitionTest.java | 2 - .../ResourceMetadataDataDefinitionTest.java | 2 - .../ServiceMetadataDataDefinitionTest.java | 2 - .../AdditionalInfoParameterDataDefinitionTest.java | 2 - .../elements/ArtifactDataDefinitionTest.java | 2 - .../elements/CapabilityDataDefinitionTest.java | 2 - .../ComponentInstanceDataDefinitionTest.java | 2 - .../elements/CompositionDataDefinitionTest.java | 2 - .../elements/ConsumerDataDefinitionTest.java | 2 - .../elements/DataTypeDataDefinitionTest.java | 2 - .../elements/GetInputValueDataDefinitionTest.java | 2 - .../elements/GroupDataDefinitionTest.java | 2 - .../elements/GroupInstanceDataDefinitionTest.java | 2 - .../elements/GroupTypeDataDefinitionTest.java | 2 - .../elements/HeatParameterDataDefinitionTest.java | 2 - .../elements/InputDataDefinitionTest.java | 2 - .../elements/InputsValueDataDefinitionTest.java | 2 - .../elements/InterfaceDataDefinitionTest.java | 2 - .../elements/ListCapabilityDataDefinitionTest.java | 2 - .../datatypes/elements/ListDataDefinitionTest.java | 2 - .../ListMapPropertiesDataDefinitionTest.java | 2 - .../ListRequirementDataDefinitionTest.java | 2 - .../elements/MapArtifactDataDefinitionTest.java | 2 - .../datatypes/elements/MapDataDefinitionTest.java | 2 - .../MapListCapabiltyDataDefinitionTest.java | 2 - .../MapListRequirementDataDefinitionTest.java | 4 - .../elements/MapPropertiesDataDefinitionTest.java | 2 - .../elements/OperationDataDefinitionTest.java | 2 - .../elements/PolicyTypeDataDefinitionTest.java | 2 - .../ProductMetadataDataDefinitionTest.java | 2 - .../elements/PropertyDataDefinitionTest.java | 3 - .../elements/RequirementDataDefinitionTest.java | 2 - .../openecomp/sdc/be/utils/CommonBeUtilsTest.java | 3 +- common/.gitignore | 13 - pom.xml | 118 +- sdc-os-chef/environments/Template.json | 16 +- sdc-os-chef/pom.xml | 22 +- .../templates/default/BE-configuration.yaml.erb | 27 +- .../sdc-normatives/recipes/import_Normatives.rb | 2 +- .../sdc-normatives/recipes/upgrade_Normatives.rb | 2 +- .../templates/default/configuration.yaml.erb | 29 +- .../ES_6_create_kibana_dashboard_virtualization.rb | 21 +- .../recipes/FE_2_setup_configuration.rb | 1 + .../templates/default/FE-configuration.yaml.erb | 8 +- sdc-os-chef/sdc-frontend/startup.sh | 2 +- .../templates/default/BE-configuration.yaml.erb | 27 +- .../sdc-sanity/files/default/Files/VNFs/ntas.csar | Bin 61134 -> 0 bytes security-utils/pom.xml | 4 + .../org/openecomp/sdc/security/PasswordTest.java | 3 +- test-apis-ci/pom.xml | 10 +- .../sdc/ci/tests/api/ComponentBaseTest.java | 131 +- .../ci/tests/api/ComponentInstanceBaseTest.java | 8 +- .../openecomp/sdc/ci/tests/api/ExtentManager.java | 23 +- .../sdc/ci/tests/api/ExtentTestActions.java | 13 +- .../sdc/ci/tests/api/ExtentTestManager.java | 17 +- .../openecomp/sdc/ci/tests/api/SomeInterface.java | 9 + .../java/org/openecomp/sdc/ci/tests/api/Urls.java | 23 +- .../org/openecomp/sdc/ci/tests/config/Config.java | 2 - .../dataProviders/OnboardingDataProviders.java | 9 +- .../dataProviders/OnbordingDataProviders.java | 76 + .../ci/tests/datatypes/AmdocsLicenseMembers.java | 51 +- .../ci/tests/datatypes/ArtifactAssetStructure.java | 1 - .../sdc/ci/tests/datatypes/ArtifactReqDetails.java | 1 - .../datatypes/ComponentInstanceReqDetails.java | 1 - .../tests/datatypes/DistributionMonitorObject.java | 69 + .../datatypes/HeatMetaFirstLevelDefinition.java | 1 - .../sdc/ci/tests/datatypes/ImportReqDetails.java | 3 - .../sdc/ci/tests/datatypes/LicensingData.java | 39 + .../sdc/ci/tests/datatypes/LicensingVersion.java | 31 + .../datatypes/ResourceExternalReqDetails.java | 1 - .../ci/tests/datatypes/ResourceRespJavaObject.java | 1 - .../tests/datatypes/ServiceDistributionStatus.java | 1 - .../sdc/ci/tests/datatypes/ServiceReqDetails.java | 8 +- .../ci/tests/datatypes/ServiceRespJavaObject.java | 2 - .../datatypes/VendorSoftwareProductObject.java | 86 +- .../VendorSoftwareProductObjectReqDetails.java | 148 + .../sdc/ci/tests/datatypes/enums/CircleSize.java | 7 + .../sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java | 19 + .../sdc/ci/tests/datatypes/enums/ErrorInfo.java | 1 - .../tests/datatypes/enums/LifeCycleStatesEnum.java | 2 - .../ci/tests/datatypes/enums/PropertyTypeEnum.java | 47 +- .../datatypes/enums/ResourceCategoryEnum.java | 118 +- .../datatypes/enums/ServiceCategoriesEnum.java | 6 + .../sdc/ci/tests/datatypes/enums/UserRoleEnum.java | 2 +- .../datatypes/expected/ExpectedExternalAudit.java | 1 - .../expected/ExpectedResourceAuditJavaObject.java | 1 - .../sdc/ci/tests/datatypes/http/HttpRequest.java | 1 - .../execute/TODO/ImportCapabilityTypeCITest.java | 8 +- .../execute/artifacts/ArtifactServletTest.java | 2 - .../execute/artifacts/DownloadComponentArt.java | 4 - .../tests/execute/artifacts/HeatEnvArtifact.java | 1 - .../execute/artifacts/PlaceHolderValidations.java | 8 - .../execute/artifacts/ValidateArtResponse.java | 1 - .../artifacts/ValidateHeatArtFieldsTypes.java | 1 - .../tests/execute/category/CatalogDataApiTest.java | 2 - .../ci/tests/execute/category/CategoriesTests.java | 2 - .../ci/tests/execute/category/ElementsApiTest.java | 10 - .../ci/tests/execute/category/GroupingTest.java | 4 - .../tests/execute/category/SubCategoriesTest.java | 1 - .../sdc/ci/tests/execute/devCI/AndreyTest.java | 29 +- .../ci/tests/execute/devCI/ArtifactFromCsar.java | 4 - .../ci/tests/execute/devCI/ImportCsarUpdate.java | 6 - .../execute/devCI/ImportCsarValidateArtifacts.java | 5 - .../ci/tests/execute/devCI/ToscaGroupInsideVF.java | 30 - .../DistributionDownloadArtifactTest.java | 3 - .../general/BasicHttpAuthenticationTest.java | 1 - .../general/ManageEcompConsumerCredentials.java | 1 - .../ci/tests/execute/imports/CsarUtilsTest.java | 2 - .../execute/imports/ImportCsarResourceTest.java | 10 +- .../imports/ImportGenericResourceCITest.java | 1 - .../execute/imports/ImportNewResourceCITest.java | 5 - .../execute/imports/ImportToscaResourceTest.java | 13 +- .../imports/ImportUpdateResourseCsarTest.java | 1 - .../tests/execute/product/ProductCheckoutTest.java | 1 - .../product/ProductCreateWithValidationsTest.java | 1 - .../ci/tests/execute/product/ProductCrudTest.java | 6 - .../tests/execute/property/PropertyApisTest.java | 4 - .../tests/execute/resource/CheckGetResource.java | 1 - .../resource/ComponentRelationshipInVfTest.java | 23 +- .../execute/resource/CreateResourceApiTest.java | 9 - .../execute/resource/GetAllResourceVersions.java | 2 - .../resource/GetResourceNotAbstractApiTest.java | 2 - .../ci/tests/execute/resource/ResourceApiTest.java | 1 - .../resource/UpdateResourceMetadataTest.java | 2 - .../resource/VFResourceInstanceNameCRUD.java | 1 - .../execute/resource/ValidateExtendedVfData.java | 4 - .../resource/VfComponentInstanceCRUDTest.java | 11 +- .../ChangeServiceDistributionStatusApiTest.java | 4 - .../service/CreateServiceMetadataApiTest.java | 4 - .../execute/service/GetAllServiceVersions.java | 1 - .../execute/service/GetComponentAuditApiTest.java | 3 - .../service/GetServiceLatestVersionTest.java | 1 - .../execute/service/ReqCapOccurrencesTest.java | 11 +- .../service/ServiceComponentInstanceCRUDTest.java | 3 - .../execute/service/UpdateServiceMetadataTest.java | 1 - .../execute/user/GovernorWorkspaceApiTest.java | 2 - .../org/openecomp/sdc/ci/tests/run/StartTest.java | 11 +- .../sdc/ci/tests/run/StartTest2backup.java | 1 - .../ci/tests/sanity/MultipleResourceUpdate.java | 5 +- .../org/openecomp/sdc/ci/tests/sanity/Onboard.java | 87 +- .../tosca/datatypes/ParametersDefinition.java | 3 - .../ci/tests/tosca/datatypes/ToscaDefinition.java | 38 +- .../tosca/datatypes/ToscaImportsDefinition.java | 1 - .../ToscaInputsTopologyTemplateDefinition.java | 227 +- ...scaNodeTemplatesTopologyTemplateDefinition.java | 61 +- .../tosca/datatypes/ToscaNodeTypesDefinition.java | 13 +- .../ToscaOutputsTopologyTemplateDefinition.java | 1 - ...ionshipTemplatesTopologyTemplateDefinition.java | 1 - .../ToscaServiceGroupsMetadataDefinition.java | 1 - .../ToscaSubstitutionMappingsDefinition.java | 6 +- .../datatypes/ToscaTopologyTemplateDefinition.java | 94 +- .../ToscaTopologyTemplateDefinition2.java | 1 - .../sdc/ci/tests/utils/CsarToscaTester.java | 61 +- .../org/openecomp/sdc/ci/tests/utils/DbUtils.java | 21 +- .../sdc/ci/tests/utils/DistributionUtils.java | 124 +- .../org/openecomp/sdc/ci/tests/utils/ReqCap.java | 8 +- .../sdc/ci/tests/utils/ToscaParserUtils.java | 3 + .../ci/tests/utils/cassandra/CassandraUtils.java | 21 +- .../ci/tests/utils/cassandra/CassandraUtils2.java | 20 +- .../tests/utils/general/AtomicOperationUtils.java | 129 +- .../sdc/ci/tests/utils/general/Convertor.java | 3 - .../sdc/ci/tests/utils/general/ElementFactory.java | 58 +- .../sdc/ci/tests/utils/general/FileHandling.java | 68 +- .../sdc/ci/tests/utils/general/ImportUtils.java | 6 - .../utils/general/OnboardingUtillViaApis.java | 87 +- .../ci/tests/utils/general/OnboardingUtils.java | 595 ++- .../sdc/ci/tests/utils/general/SnmpTypeEnum.java | 50 - .../utils/general/SnmpTypeEnum.java~release_1802E | 88 + .../sdc/ci/tests/utils/rest/AssetRestUtils.java | 6 +- .../sdc/ci/tests/utils/rest/CatalogRestUtils.java | 3 +- .../sdc/ci/tests/utils/rest/ConsumerRestUtils.java | 1 + .../sdc/ci/tests/utils/rest/ImportRestUtils.java | 1 - .../sdc/ci/tests/utils/rest/ProductRestUtils.java | 4 +- .../sdc/ci/tests/utils/rest/PropertyRestUtils.java | 30 + .../sdc/ci/tests/utils/rest/ResourceRestUtils.java | 4 +- .../utils/rest/ResourceRestUtilsExternalAPI.java | 1 - .../sdc/ci/tests/utils/rest/ResponseParser.java | 41 +- .../utils/validation/ArtifactValidationUtils.java | 2 - .../utils/validation/AuditValidationUtils.java | 34 - .../utils/validation/BaseValidationUtils.java | 1 - .../utils/validation/CategoryValidationUtils.java | 3 +- .../utils/validation/CsarValidationUtils.java | 11 - .../utils/validation/ErrorValidationUtils.java | 2 +- .../utils/validation/ServiceValidationUtils.java | 3 +- .../utils/validation/UserValidationUtils.java | 2 +- .../openecomp/sdc/externalApis/AssetLifeCycle.java | 36 +- .../sdc/externalApis/CRUDExternalAPI.java | 13 +- .../sdc/externalApis/DeploymentValiditaion.java | 2 - .../sdc/externalApis/GetAssetServlet.java | 2 - .../sdc/externalApis/GetFilteredAssetServlet.java | 1 - .../GetSpecificAssetMetadataServlet.java | 1 - .../org/openecomp/sdc/externalApis/UserAPIs.java | 6 +- .../sdc/externalApis/VFCMTExternalAPI.java | 5 - .../src/main/resources/ci/conf/attsdc.yaml | 8 +- .../src/main/resources/ci/conf/titan.properties | 7 +- .../main/resources/ci/testSuites/externalAPIs.xml | 2 +- .../src/main/resources/ci/testSuites/onap.xml | 2 + ui-ci/pom.xml | 8 +- .../US/AddComponentInstancesArtifactsInCsar.java | 26 +- .../sdc/ci/tests/US/LocalGeneralUtilities.java | 13 +- .../tests/US/MIBsArtifactsOnResourceInstance.java | 2 - .../org/openecomp/sdc/ci/tests/US/MobProxy.java | 4 +- .../sdc/ci/tests/US/NewArtifactTypeGuide.java | 1 - .../US/RemoveRestrictionOfDeploymentArtifacts.java | 1 - .../sdc/ci/tests/US/Service_Tests_UI.java | 12 +- .../org/openecomp/sdc/ci/tests/US/Testing.java | 6 +- .../org/openecomp/sdc/ci/tests/US/VfModule.java | 20 +- .../org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java | 26 +- ...ndNode_TemplatePropertiesWithDefaultValues.java | 4 +- .../tests/businesslogic/ArtifactBusinessLogic.java | 14 +- .../tests/dataProvider/OnbordingDataProviders.java | 72 +- .../ci/tests/datatypes/AmdocsLicenseMembers.java | 56 - .../sdc/ci/tests/datatypes/CanvasManager.java | 151 +- .../datatypes/ConnectionWizardPopUpObject.java | 58 + .../sdc/ci/tests/datatypes/DataTestIdEnum.java | 68 +- .../sdc/ci/tests/datatypes/ServiceContainer.java | 51 + .../sdc/ci/tests/datatypes/TypesEnum.java | 2 +- .../sdc/ci/tests/datatypes/UserManagementTab.java | 1 + .../datatypes/VendorSoftwareProductObject.java | 86 +- .../tests/execute/sanity/AdminUserManagment.java | 8 +- .../tests/execute/sanity/DeploymentViewTests.java | 53 +- .../sdc/ci/tests/execute/sanity/ImportDCAE.java | 3 +- .../ci/tests/execute/sanity/ImportVFCAsset.java | 40 +- .../sdc/ci/tests/execute/sanity/Onboard.java | 77 +- .../ci/tests/execute/sanity/OnboardViaApis.java | 230 +- .../ci/tests/execute/sanity/OnboardingFlows.java | 400 ++ .../openecomp/sdc/ci/tests/execute/sanity/PNF.java | 127 +- .../sdc/ci/tests/execute/sanity/PortMirroring.java | 124 + .../tests/execute/sanity/PropertiesAssignment.java | 95 + .../sdc/ci/tests/execute/sanity/Service.java | 49 +- .../tests/execute/sanity/ToscaValidationTest.java | 599 ++- .../sdc/ci/tests/execute/sanity/VFCArtifacts.java | 79 +- .../openecomp/sdc/ci/tests/execute/sanity/Vf.java | 20 +- .../sdc/ci/tests/execute/sanity/VfArtifacts.java | 111 +- .../sanity/VfDeploymentInformationalArtifacts.java | 71 +- .../sdc/ci/tests/execute/setup/AttFtpClient.java | 4 - .../sdc/ci/tests/execute/setup/DriverFactory.java | 7 +- .../ci/tests/execute/setup/ExtentTestActions.java | 11 +- .../ci/tests/execute/setup/ExtentTestManager.java | 15 +- .../sdc/ci/tests/execute/setup/MobProxy.java | 2 - .../sdc/ci/tests/execute/setup/Retry.java | 2 - .../sdc/ci/tests/execute/setup/SetupCDTest.java | 39 +- .../ci/tests/execute/setup/WebDriverThread.java | 12 +- .../ci/tests/execute/setup/WindowTestManager.java | 2 - .../sdc/ci/tests/pages/DeploymentArtifactPage.java | 1 + .../sdc/ci/tests/pages/DeploymentPage.java | 4 - .../org/openecomp/sdc/ci/tests/pages/HomePage.java | 1 - .../ci/tests/pages/PropertiesAssignmentPage.java | 149 + .../sdc/ci/tests/pages/ResourceLeftMenu.java | 4 + .../sdc/ci/tests/pages/UploadArtifactPopup.java | 1 - .../ci/tests/utilities/AdditionalConditions.java | 2 - .../sdc/ci/tests/utilities/ArtifactUIUtils.java | 12 +- .../sdc/ci/tests/utilities/CanvasElement.java | 54 - .../sdc/ci/tests/utilities/CanvasManager.java | 179 - .../sdc/ci/tests/utilities/CatalogUIUtilitis.java | 3 +- .../sdc/ci/tests/utilities/DownloadManager.java | 36 +- .../sdc/ci/tests/utilities/FileHandling.java | 34 +- .../sdc/ci/tests/utilities/GeneralUIUtils.java | 11 +- .../sdc/ci/tests/utilities/HomeUtils.java | 1 - .../sdc/ci/tests/utilities/OnboardingUiUtils.java | 969 +++++ .../ci/tests/utilities/OnboardingUtillViaApis.java | 362 +- .../sdc/ci/tests/utilities/OnboardingUtils.java | 814 ---- .../sdc/ci/tests/utilities/PropertiesUIUtils.java | 4 +- .../sdc/ci/tests/utilities/ResourceUIUtils.java | 3 - .../sdc/ci/tests/utilities/RestCDUtils.java | 16 +- .../ci/tests/verificator/CatalogVerificator.java | 18 +- .../verificator/DeploymentViewVerificator.java | 103 +- .../verificator/ErrorMessageUIVerificator.java | 3 +- .../ci/tests/verificator/PropertyVerificator.java | 18 + .../ci/tests/verificator/ServiceVerificator.java | 4 - .../sdc/ci/tests/verificator/ToscaValidation.java | 198 +- .../verificator/UserManagementVerificator.java | 2 - .../ci/tests/verificator/VfModuleVerificator.java | 23 +- .../sdc/ci/tests/verificator/VfVerificator.java | 10 +- ui-ci/src/main/resources/ci/conf/attsdc.yaml | 16 +- ui-ci/src/main/resources/ci/scripts/startTest.sh | 4 +- .../ci/testSuites/devOnboardE2EOneFileSanity.xml | 14 + .../resources/ci/testSuites/extendedSanity.xml | 12 +- .../testSuites/onboardVNFWithoutDistribution.xml | 16 + .../ci/testSuites/toscaValidationSuite.xml | 2 +- utils/webseal-simulator/pom.xml | 5 +- .../org/openecomp/sdc/webseal/simulator/Login.java | 1 - .../openecomp/sdc/webseal/simulator/conf/Conf.java | 1 + 1408 files changed, 64329 insertions(+), 13281 deletions(-) create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfiguration.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactUUIDFixMenu.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/IMigrationStage.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/PostMigration.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/OutputHandler.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandler.java create mode 100644 asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java create mode 100644 asdctool/src/main/resources/config/Artifact-Generator.properties create mode 100644 asdctool/src/main/resources/elasticsearch.yml create mode 100644 asdctool/src/main/resources/scripts/artifactsIdValidation.sh create mode 100644 asdctool/src/main/resources/scripts/upgradePostMigration1710.sh create mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java delete mode 100644 catalog-be/.gitignore create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/RelationsComparator.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/TopologyComparator.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBL.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMerge.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMerge.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeInterface.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMerge.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComplexPropertyValueMerger.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBL.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBL.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/MergePropertyData.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyValueMerger.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ScalarPropertyValueMerger.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBLFactory.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogic.java create mode 100644 catalog-be/src/main/java/org/openecomp/sdc/be/exception/SdcActionException.java create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.zip create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.zip create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extNeutronCP/extNeutronCP.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extNeutronCP/extNeutronCP.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/extNeutronCP/extNeutronCP.zip create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroring/portMirroring.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroring/portMirroring.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroring/portMirroring.zip create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.zip create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.json create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.yml create mode 100644 catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.zip create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/DummyConfigurationManager.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/RelationsComparatorTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/TopologyComparatorTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBLTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMergeTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceDataMergingTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMergeTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMergeTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBLTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBLTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogicTest.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ArtifactBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentInstanceBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/HeatParameterBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ObjectGenerator.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/RelationsBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ResourceBuilder.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java create mode 100644 catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentName.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRelationship.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementName.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementNode.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentType.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessInstances.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessRequirements.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeOrig.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeReuirementWithDifferentCapability.yaml create mode 100644 catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeWithMissingRelationship.yaml delete mode 100644 catalog-dao/.gitignore delete mode 100644 catalog-model/.gitignore create mode 100644 catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityRequirementRelationship.java rename catalog-model/src/main/java/org/openecomp/sdc/be/model/{RequirementAndRelationshipPair.java => RelationshipInfo.java} (88%) delete mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPairTest.java create mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperationTest.java delete mode 100644 catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.html delete mode 100644 catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.less delete mode 100644 catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.ts delete mode 100644 catalog-ui/src/app/directives/layout/top-nav/top-nav.html delete mode 100644 catalog-ui/src/app/directives/layout/top-nav/top-nav.less delete mode 100644 catalog-ui/src/app/directives/layout/top-nav/top-nav.ts create mode 100644 catalog-ui/src/app/models/componentsInstances/serviceProxyInstance.ts rename catalog-ui/src/app/models/graph/{relationMenuObjects.ts => connectRelationModel.ts} (80%) rename catalog-ui/src/app/{ng2/components/dynamic-element/elements-ui/checkbox/ui-element-checkbox.component.ts => models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts} (54%) create mode 100644 catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts create mode 100644 catalog-ui/src/app/models/radio-button.ts create mode 100644 catalog-ui/src/app/models/wizard-step.ts create mode 100644 catalog-ui/src/app/ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component.html create mode 100644 catalog-ui/src/app/ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component.ts create mode 100644 catalog-ui/src/app/ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.module.ts delete mode 100644 catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.module.ts delete mode 100644 catalog-ui/src/app/ng2/components/dynamic-element/elements-ui/checkbox/ui-element-checkbox.component.html delete mode 100644 catalog-ui/src/app/ng2/components/dynamic-element/elements-ui/checkbox/ui-element-checkbox.component.less delete mode 100644 catalog-ui/src/app/ng2/components/dynamic-element/elements-ui/dropdown/ui-element-dropdown.component.html create mode 100644 catalog-ui/src/app/ng2/components/layout/layout.module.ts create mode 100644 catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.html create mode 100644 catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.less create mode 100644 catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts rename catalog-ui/src/app/ng2/components/{ => logic}/filter-properties-assignment/filter-properties-assignment.component.html (83%) rename catalog-ui/src/app/ng2/components/{ => logic}/filter-properties-assignment/filter-properties-assignment.component.less (95%) rename catalog-ui/src/app/ng2/components/{ => logic}/filter-properties-assignment/filter-properties-assignment.component.ts (96%) rename catalog-ui/src/app/ng2/components/{ => logic}/hierarchy-navigtion/hierarchy-display-options.ts (100%) rename catalog-ui/src/app/ng2/components/{ => logic}/hierarchy-navigtion/hierarchy-navigation.component.html (83%) rename catalog-ui/src/app/ng2/components/{ => logic}/hierarchy-navigtion/hierarchy-navigation.component.less (100%) rename catalog-ui/src/app/ng2/components/{ => logic}/hierarchy-navigtion/hierarchy-navigation.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => logic}/inputs-table/inputs-table.component.html (98%) rename catalog-ui/src/app/ng2/components/{ => logic}/inputs-table/inputs-table.component.less (98%) rename catalog-ui/src/app/ng2/components/{ => logic}/inputs-table/inputs-table.component.ts (90%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/dynamic-property/dynamic-property.component.html (91%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/dynamic-property/dynamic-property.component.less (85%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/dynamic-property/dynamic-property.component.ts (96%) rename catalog-ui/src/app/ng2/{ => components/logic/properties-table}/pipes/filterChildProperties.pipe.ts (100%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/properties-table.component.html (79%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/properties-table.component.less (85%) rename catalog-ui/src/app/ng2/components/{ => logic}/properties-table/properties-table.component.ts (81%) create mode 100644 catalog-ui/src/app/ng2/components/logic/properties-table/property-table.module.ts create mode 100644 catalog-ui/src/app/ng2/components/logic/select-requirement-or-capability/select-reqiurement-or-capability.component.less create mode 100644 catalog-ui/src/app/ng2/components/logic/select-requirement-or-capability/select-requirement-or-capability.component.html create mode 100644 catalog-ui/src/app/ng2/components/logic/select-requirement-or-capability/select-requirement-or-capability.component.ts create mode 100644 catalog-ui/src/app/ng2/components/logic/select-requirement-or-capability/select-requirement-or-capability.module.ts delete mode 100644 catalog-ui/src/app/ng2/components/modal/modal.component.less rename catalog-ui/src/app/ng2/components/{ => ui}/dynamic-element/dynamic-element.component.less (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/dynamic-element/dynamic-element.component.ts (72%) create mode 100644 catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.module.ts rename catalog-ui/src/app/ng2/{shared => components/ui/form-components}/checkbox/checkbox.component.html (100%) rename catalog-ui/src/app/ng2/{shared => components/ui/form-components}/checkbox/checkbox.component.less (92%) rename catalog-ui/src/app/ng2/{shared => components/ui/form-components}/checkbox/checkbox.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui/form-components}/checkbox/checkbox.module.ts (100%) create mode 100644 catalog-ui/src/app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component.html rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/dropdown/ui-element-dropdown.component.less (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/dropdown/ui-element-dropdown.component.ts (82%) create mode 100644 catalog-ui/src/app/ng2/components/ui/form-components/form-elements.module.ts rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/input/ui-element-input.component.html (80%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/input/ui-element-input.component.less (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/input/ui-element-input.component.ts (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/integer-input/ui-element-integer-input.component.html (79%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/integer-input/ui-element-integer-input.component.less (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/integer-input/ui-element-integer-input.component.ts (96%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/popover-input/ui-element-popover-input.component.html (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/popover-input/ui-element-popover-input.component.less (100%) rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/popover-input/ui-element-popover-input.component.ts (93%) create mode 100644 catalog-ui/src/app/ng2/components/ui/form-components/radio-buttons/radio-button.component.less create mode 100644 catalog-ui/src/app/ng2/components/ui/form-components/radio-buttons/radio-buttons.component.html create mode 100644 catalog-ui/src/app/ng2/components/ui/form-components/radio-buttons/radio-buttons.component.ts rename catalog-ui/src/app/ng2/components/{dynamic-element/elements-ui => ui/form-components}/ui-element-base.component.ts (92%) rename catalog-ui/src/app/ng2/components/{ => ui}/loader/loader.component.html (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/loader/loader.component.less (96%) rename catalog-ui/src/app/ng2/components/{ => ui}/loader/loader.component.ts (100%) create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-item.component.html create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-item.component.less create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-item.component.ts create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-list.component.html create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-list.component.less create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-list.component.ts create mode 100644 catalog-ui/src/app/ng2/components/ui/menu/menu-list.module.ts rename catalog-ui/src/app/ng2/components/{ => ui}/modal/error-message/error-message.component.html (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/modal/error-message/error-message.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/modal/modal.component.html (93%) create mode 100644 catalog-ui/src/app/ng2/components/ui/modal/modal.component.less rename catalog-ui/src/app/ng2/components/{ => ui}/modal/modal.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/modal/modal.module.ts (84%) create mode 100644 catalog-ui/src/app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard-header-base.component.ts create mode 100644 catalog-ui/src/app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard.component.html create mode 100644 catalog-ui/src/app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard.component.less create mode 100644 catalog-ui/src/app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard.component.ts create mode 100644 catalog-ui/src/app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard.module.ts rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar-routes.config.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar.component.html (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar.component.less (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar.metadata.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/navbar/navbar.module.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/popover/popover-content.component.html (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/popover/popover-content.component.less (90%) rename catalog-ui/src/app/ng2/components/{ => ui}/popover/popover-content.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/popover/popover.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/popover/popover.module.ts (95%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-bar/search-bar.component.html (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-bar/search-bar.component.less (85%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-bar/search-bar.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-with-autocomplete/search-with-autocomplete.component.html (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-with-autocomplete/search-with-autocomplete.component.less (95%) rename catalog-ui/src/app/ng2/{shared => components/ui}/search-with-autocomplete/search-with-autocomplete.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/tabs/tab/tab.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/tabs/tabs.component.html (81%) rename catalog-ui/src/app/ng2/{shared => components/ui}/tabs/tabs.component.less (95%) rename catalog-ui/src/app/ng2/{shared => components/ui}/tabs/tabs.component.ts (100%) rename catalog-ui/src/app/ng2/{shared => components/ui}/tabs/tabs.module.ts (97%) rename catalog-ui/src/app/ng2/components/{ => ui}/tooltip/tooltip-content.component.html (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/tooltip/tooltip-content.component.less (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/tooltip/tooltip-content.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/tooltip/tooltip.component.ts (100%) rename catalog-ui/src/app/ng2/components/{ => ui}/tooltip/tooltip.module.ts (98%) create mode 100644 catalog-ui/src/app/ng2/components/ui/ui-elements.module.ts create mode 100644 catalog-ui/src/app/ng2/config/sdc-config.config.factory.ts create mode 100644 catalog-ui/src/app/ng2/config/sdc-config.config.ts create mode 100644 catalog-ui/src/app/ng2/config/translation.service.config.factory.ts create mode 100644 catalog-ui/src/app/ng2/config/translation.service.config.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-properties-view/connection-properties-view.component.html create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-properties-view/connection-properties-view.component.less create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-properties-view/connection-properties-view.component.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-wizard-header/connection-wizard-header.component.html create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-wizard-header/connection-wizard-header.component.less create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-wizard-header/connection-wizard-header.component.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-wizard.module.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/connection-wizard.service.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/from-node-step/from-node-step.component.html create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/from-node-step/from-node-step.component.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/properties-step/properties-step.component.html create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/properties-step/properties-step.component.less create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/properties-step/properties-step.component.ts create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/to-node-step/to-node-step.component.html create mode 100644 catalog-ui/src/app/ng2/pages/connection-wizard/to-node-step/to-node-step.component.ts rename catalog-ui/src/app/ng2/{ => pages/properties-assignment}/services/hierarchy-nav.service.ts (100%) rename catalog-ui/src/app/ng2/pages/properties-assignment/{ => services}/properties.utils.ts (93%) create mode 100644 catalog-ui/src/app/ng2/pipes/global-pipes.module.ts rename catalog-ui/src/app/ng2/services/{ => component-services}/component-mode.service.ts (95%) create mode 100644 catalog-ui/src/app/ng2/services/user.service.ts rename catalog-ui/src/app/ng2/shared/{shared.module.ts => translator/translate.module.ts} (74%) create mode 100644 catalog-ui/src/app/ng2/shared/translator/translate.pipe.ts create mode 100644 catalog-ui/src/app/ng2/shared/translator/translate.service.config.ts create mode 100644 catalog-ui/src/app/ng2/shared/translator/translate.service.ts delete mode 100644 catalog-ui/src/app/services/user-resource-service.ts create mode 100644 catalog-ui/src/assets/styles/images/resource-icons/dcae_machineLearning.png create mode 100644 catalog-ui/src/assets/styles/images/resource-icons/pmc.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/call_controll.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/collaboration.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/compute.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/defaulticon.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/messaging.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/mobility.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/network_l_1-3.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/network_l_4.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/notification.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/platform.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/storage.png create mode 100644 catalog-ui/src/assets/styles/images/service-proxy-icons/uncertified.png create mode 100644 catalog-ui/src/assets/styles/sprite-proxy-services-icons.less delete mode 100644 common-app-api/.gitignore create mode 100644 common-app-api/src/main/java/org/openecomp/sdc/common/util/HealthCheckUtil.java delete mode 100644 common-be/.gitignore delete mode 100644 common/.gitignore delete mode 100644 sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ntas.csar create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/SomeInterface.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DistributionMonitorObject.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingData.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingVersion.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObjectReqDetails.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CircleSize.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java create mode 100644 test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java~release_1802E delete mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AmdocsLicenseMembers.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ConnectionWizardPopUpObject.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlows.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java delete mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CanvasElement.java delete mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CanvasManager.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java delete mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtils.java create mode 100644 ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertyVerificator.java create mode 100644 ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml create mode 100644 ui-ci/src/main/resources/ci/testSuites/onboardVNFWithoutDistribution.xml diff --git a/.gitignore b/.gitignore index a8e24a136c..deee135e48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,68 @@ +# Eclipse IDE +#------------------------------------------------------------ +**/.classpath +**/.project +**/.tern-project +**/.settings/** +**/bin/ + + +# IntelliJ IDE +#------------------------------------------------------------ +**/.idea/ +/out/ +*.iml + +# IntelliJ IDE +#------------------------------------------------------------ +**/.idea/ +/out/ +*.iml !catalog-fe/src/main/webapp/META-INF/ !catalog-fe/src/main/webapp/WEB-INF/ # Eclipse # Maven -# Package Files # +#------------------------------------------------------------ +**/target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +version.properties +dependency-reduced-pom.xml + ## sdc-os-chef *.class +# Package Files + +# Package Files +#------------------------------------------------------------ *.ear *.iml *.jar +#Gradle +build.gradle +.gradle/* + +/log +#Gradle +build.gradle +.gradle/* + +/log *.kpf *.orig *.war .classpath .delivery .idea/* + + +# catalog-ui +#------------------------------------------------------------ + + +catalog-ui/app/dist/* .metadata/ .metadata/* .project @@ -39,6 +87,7 @@ catalog-fe/bin catalog-fe/src/main/webapp/* catalog-ui/*.tmp.txt catalog-ui/.* +catalog-ui/app/dist/* catalog-ui/.editorconfig catalog-ui/.jshintrc catalog-ui/.yo-rc.json @@ -53,7 +102,16 @@ catalog-ui/app/scripts/references.ts catalog-ui/app/scripts/tsconfig.json catalog-ui/app/tsconfig.json catalog-ui/bower_components/ +catalog-ui/package-lock.json catalog-ui/dist +catalog-ui/*.tmp.txt +catalog-ui/tests/Coverage/* +catalog-ui/Chrome* +catalog-ui/PhantomJS_1.9.8_(Windows_7_0.0.0)/* +catalog-ui/*.tmp.txt +catalog-ui/tests/Coverage/* +catalog-ui/Chrome* +catalog-ui/PhantomJS_1.9.8_(Windows_7_0.0.0)/* catalog-ui/node/* catalog-ui/node_modules/ catalog-ui/npm-debug.log @@ -81,6 +139,7 @@ data/root.png data/router.png data/software.png data/volume.png + distribution-ci/logs/wordnik.log distribution-ci/logs/wordnik.log.1 distribution-ci/logs/wordnik.log.10 @@ -93,6 +152,7 @@ distribution-ci/logs/wordnik.log.7 distribution-ci/logs/wordnik.log.8 distribution-ci/logs/wordnik.log.9 dox-sequence-diagram-ui/node/* + log.home_IS_UNDEFINED/ASDC/ASDC-BE/Error.log log.home_IS_UNDEFINED/ASDC/ASDC-BE/audit.log log.home_IS_UNDEFINED/ASDC/ASDC-BE/debug.log @@ -147,3 +207,11 @@ ui-ci/test-output/testng-failed.xml ui-ci/test-output/testng-results.xml utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/logback.xml vagrant-asdc-all-in-one/ + + +sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* +/asdctool/*.xls + +/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/tools/build/scripts/* + +sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* diff --git a/LICENSE.TXT b/LICENSE.TXT index 1fe74888cd..79c4085129 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -18,4 +18,5 @@ * limitations under the License. * ============LICENSE_END============================================ * ECOMP is a trademark and service mark of AT&T Intellectual Property. -*/ \ No newline at end of file + +*/ diff --git a/asdc-tests/pom.xml b/asdc-tests/pom.xml index a37d1e8a9c..9cc5898fcc 100644 --- a/asdc-tests/pom.xml +++ b/asdc-tests/pom.xml @@ -47,8 +47,7 @@ org.mockito - mockito-all - 1.10.19 + mockito-core compile diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java index 6c0b96e15c..b0627b8cfc 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.ci.tests.api; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; @@ -43,8 +41,8 @@ import org.openecomp.sdc.ci.tests.rules.MyTestWatcher; import org.openecomp.sdc.ci.tests.run.StartTest; import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.FileUtils; -import org.slf4j.LoggerFactory; import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java index 0f85cc792d..18824876cb 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java @@ -76,7 +76,6 @@ import org.testng.annotations.BeforeSuite; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; -import com.relevantcodes.extentreports.NetworkMode; import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; import com.thinkaurelius.titan.core.TitanVertex; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java index 60c226136d..90d818af77 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java @@ -46,7 +46,7 @@ import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Product; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -683,7 +683,7 @@ public class ComponentInstanceBaseTest extends ComponentBaseTest { private void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) { // removing from requirements - RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0); + RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation(); String type = relationship.getRelationship().getType(); String fromId = requirementDef.getFromNode(); List reqList = expectedContainerRequirements.get(type); @@ -771,7 +771,7 @@ public class ComponentInstanceBaseTest extends ComponentBaseTest { private void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) { // adding to requirements - RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0); + RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation(); String type = relationship.getRelationship().getType(); String fromId = requirementDef.getFromNode(); Map> map = removedRequirements.get(fromId); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java index 489f229c61..28606af14d 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.ci.tests.datatypes; import java.util.List; -import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.HeatParameterDefinition; public class ArtifactReqDetails { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java index 638ece8c6d..0089eec5a7 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java @@ -32,12 +32,9 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Set; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jettison.json.JSONArray; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java index a5132e8bf6..4d5806b90f 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.ci.tests.datatypes; import java.util.List; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Resource; public class ResourceExternalReqDetails extends ComponentReqDetails { String vendorName; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java index 022caecf41..4be171eff0 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java @@ -29,6 +29,7 @@ public class ServiceReqDetails extends ComponentReqDetails { String serviceType; String serviceRole; + String environmentContext; public ServiceReqDetails(String serviceName, String category, ArrayList tags, String description, String contactId, String icon) { @@ -45,7 +46,7 @@ public class ServiceReqDetails extends ComponentReqDetails { categoryDefinition.setName(category); categories = new ArrayList<>(); categories.add(categoryDefinition); - + this.environmentContext = ""; } public ServiceReqDetails(Service service) { @@ -63,7 +64,7 @@ public class ServiceReqDetails extends ComponentReqDetails { this.version = service.getVersion(); this.serviceType = service.getServiceType(); this.serviceRole = service.getServiceRole(); - + this.environmentContext = service.getEnvironmentContext(); } public ServiceReqDetails() { @@ -95,4 +96,11 @@ public class ServiceReqDetails extends ComponentReqDetails { return null; } + public String getEnvironmentContext() { + return environmentContext; + } + + public void setEnvironmentContext(String environmentContext) { + this.environmentContext = environmentContext; + } } diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java index 9edfb9aced..7c330a3d10 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.ci.tests.datatypes.enums; -import java.util.List; - public enum LifeCycleStatesEnum { CHECKOUT("checkout", "NOT_CERTIFIED_CHECKOUT"), diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java index 76296acf82..7e98d52109 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.ci.tests.datatypes.enums; -import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java index 71e75c9a1e..3af40c5bb8 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java @@ -20,9 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.TODO; -import org.testng.annotations.AfterClass; -import org.testng.annotations.Test; -import org.testng.AssertJUnit; import java.io.File; import java.io.IOException; @@ -36,8 +33,11 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.DbUtils.TitanState; +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.testng.AssertJUnit; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; import fj.data.Either; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java index 1f578d108c..49b556fc28 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java @@ -61,10 +61,8 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.general.FileUtils; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java index 2e7b6ea4af..63d0221d32 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java @@ -39,20 +39,15 @@ import org.javatuples.Pair; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.Product; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; @@ -68,14 +63,11 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.general.FileUtils; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; -import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.BeforeMethod; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java index d3ff8b7957..4c50932709 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java @@ -20,6 +20,13 @@ package org.openecomp.sdc.ci.tests.execute.artifacts; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; @@ -45,13 +52,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import org.yaml.snakeyaml.Yaml; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - public class ValidateArtResponse extends ComponentBaseTest { @Rule diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java index 44b781f065..11c80d4a61 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java @@ -20,7 +20,11 @@ package org.openecomp.sdc.ci.tests.execute.category; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -34,7 +38,11 @@ import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.*; +import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java index 3b85c052a1..ade662a20c 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java @@ -54,7 +54,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; @@ -62,7 +61,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils; import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; -import org.testng.SkipException; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java index 2f48f4fa1e..7f30f8ca92 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java @@ -26,7 +26,6 @@ import static org.testng.AssertJUnit.assertNotNull; import java.util.HashMap; import java.util.Map; -import org.apache.log4j.lf5.util.ResourceUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java index f6b6113b99..7858b3259f 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java @@ -32,9 +32,6 @@ import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RE import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS; import static org.testng.AssertJUnit.assertEquals; -import java.util.ArrayList; -import java.util.List; - import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -47,7 +44,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java index dcc3172d59..dd96ebfc2f 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java @@ -47,7 +47,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java index 45dbf315fb..52db5bcb36 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.ci.tests.execute.devCI; +import static java.util.Arrays.asList; + import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Arrays; @@ -99,9 +101,6 @@ import com.relevantcodes.extentreports.LogStatus; import fj.data.Either; - -import static java.util.Arrays.asList; - public class CRUDExternalAPI extends ComponentBaseTest { private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName()); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/HealthCheckAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/HealthCheckAPI.java index 5437b80cd7..5155562e35 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/HealthCheckAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/HealthCheckAPI.java @@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -14,8 +13,8 @@ import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.CommonRestUtils; +import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.testng.annotations.Test; @@ -27,8 +26,6 @@ public class HealthCheckAPI extends ComponentBaseTest { @Rule public static TestName name = new TestName(); - private static final int STATUS_CODE_GET_SUCCESS = 200; - public HealthCheckAPI() { super(name, HealthCheckAPI.class.getName()); } @@ -41,18 +38,36 @@ public class HealthCheckAPI extends ComponentBaseTest { Gson gson = new Gson(); HealthCheckWrapper healthCheckInfo = gson.fromJson(healthCheckInfoResponse.getResponse(), HealthCheckWrapper.class); assertNotNull("Health check not contains components info", healthCheckInfo.getComponentsInfo()); - HealthCheckInfo amdocsHC = healthCheckInfo.getComponentsInfo().stream().filter(x -> x.getHealthCheckComponent() == HealthCheckInfo.HealthCheckComponent.ON_BOARDING).findFirst().orElse(null); + HealthCheckInfo amdocsHC = healthCheckInfo.getComponentsInfo().stream().filter(x -> x.getHealthCheckComponent().equals(Constants.HC_COMPONENT_ON_BOARDING)).findFirst().orElse(null); assertNotNull("Amdocs health check not exists in Health Check info", amdocsHC); assertEquals("Amdocs health check is down", HealthCheckInfo.HealthCheckStatus.UP, amdocsHC.getHealthCheckStatus()); - assertNotNull("Amdocs additionalInfo not exists in health check", amdocsHC.getComponentsInfo()); - Map amdocsHCComponents = amdocsHC.getComponentsInfo().stream().collect(Collectors.toMap(HealthCheckInfo::getHealthCheckComponent, HealthCheckInfo::getHealthCheckStatus)); + assertNotNull("Amdocs componentsInfo not exists in health check", amdocsHC.getComponentsInfo()); + Map amdocsHCComponents = amdocsHC.getComponentsInfo().stream().collect(Collectors.toMap(HealthCheckInfo::getHealthCheckComponent, HealthCheckInfo::getHealthCheckStatus)); assertNotNull(amdocsHCComponents); - assertTrue("Amdocs health check ZU component is down or not exists", amdocsHCComponents.get(HealthCheckComponent.ZU) != null && amdocsHCComponents.get(HealthCheckComponent.ZU).equals(HealthCheckStatus.UP)); - assertTrue("Amdocs health check BE component is down or not exists", amdocsHCComponents.get(HealthCheckComponent.BE) != null && amdocsHCComponents.get(HealthCheckComponent.BE).equals(HealthCheckStatus.UP)); - assertTrue("Amdocs health check CAS component is down or not exists", amdocsHCComponents.get(HealthCheckComponent.CAS) != null && amdocsHCComponents.get(HealthCheckComponent.CAS).equals(HealthCheckStatus.UP)); - assertTrue("Amdocs health check FE component is down or not exists", amdocsHCComponents.get(HealthCheckComponent.FE) != null && amdocsHCComponents.get(HealthCheckComponent.FE).equals(HealthCheckStatus.UP)); + assertTrue("Amdocs health check ZU component is down or not exists", amdocsHCComponents.get("ZU") != null && amdocsHCComponents.get("ZU").equals(HealthCheckStatus.UP)); + assertTrue("Amdocs health check BE component is down or not exists", amdocsHCComponents.get("BE") != null && amdocsHCComponents.get("BE").equals(HealthCheckStatus.UP)); + assertTrue("Amdocs health check CAS component is down or not exists", amdocsHCComponents.get("CAS") != null && amdocsHCComponents.get("CAS").equals(HealthCheckStatus.UP)); + assertTrue("Amdocs health check FE component is down or not exists", amdocsHCComponents.get("FE") != null && amdocsHCComponents.get("FE").equals(HealthCheckStatus.UP)); } - + + @Test + public void checkDcaeHealthCheckAPI() throws Exception { + RestResponse healthCheckInfoResponse = CommonRestUtils.getHealthCheck(); + BaseRestUtils.checkSuccess(healthCheckInfoResponse); + + Gson gson = new Gson(); + HealthCheckWrapper healthCheckInfo = gson.fromJson(healthCheckInfoResponse.getResponse(), HealthCheckWrapper.class); + assertNotNull("Health check not contains components info", healthCheckInfo.getComponentsInfo()); + HealthCheckInfo dcaeHC = healthCheckInfo.getComponentsInfo().stream().filter(x -> x.getHealthCheckComponent().equals(Constants.HC_COMPONENT_DCAE)).findFirst().orElse(null); + assertNotNull("DCAE health check not exists in Health Check info", dcaeHC); + assertEquals("DCAE health check is down", HealthCheckInfo.HealthCheckStatus.UP, dcaeHC.getHealthCheckStatus()); + assertNotNull("DCAE componentsInfo not exists in health check", dcaeHC.getComponentsInfo()); + Map dcaeHCComponents = dcaeHC.getComponentsInfo().stream().collect(Collectors.toMap(HealthCheckInfo::getHealthCheckComponent, HealthCheckInfo::getHealthCheckStatus)); + assertNotNull(dcaeHCComponents); + assertTrue("DCAE health check BE component is down or not exists", dcaeHCComponents.get("BE") != null && dcaeHCComponents.get("BE").equals(HealthCheckStatus.UP)); + assertTrue("DCAE health check FE component is down or not exists", dcaeHCComponents.get("FE") != null && dcaeHCComponents.get("FE").equals(HealthCheckStatus.UP)); + } + @Test public void checkCassandraHealthCheck() throws Exception { RestResponse healthCheckInfoResponse = CommonRestUtils.getHealthCheck(); @@ -61,7 +76,7 @@ public class HealthCheckAPI extends ComponentBaseTest { Gson gson = new Gson(); HealthCheckWrapper healthCheckInfo = gson.fromJson(healthCheckInfoResponse.getResponse(), HealthCheckWrapper.class); assertNotNull("Health check not contains components info", healthCheckInfo.getComponentsInfo()); - HealthCheckInfo cassandraHC = healthCheckInfo.getComponentsInfo().stream().filter(x -> x.getHealthCheckComponent() == HealthCheckInfo.HealthCheckComponent.CASSANDRA).findFirst().orElse(null); + HealthCheckInfo cassandraHC = healthCheckInfo.getComponentsInfo().stream().filter(x -> x.getHealthCheckComponent().equals(Constants.HC_COMPONENT_CASSANDRA)).findFirst().orElse(null); assertNotNull("Cassandra health check not exists in Health Check info", cassandraHC); assertEquals("Cassandra health check is down", HealthCheckInfo.HealthCheckStatus.UP, cassandraHC.getHealthCheckStatus()); } diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java index dd078377db..87eb6dc696 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java @@ -20,20 +20,15 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import static org.testng.AssertJUnit.assertTrue; - import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.execute.imports.ImportCsarResourceTest; @@ -42,7 +37,6 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; -import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java index 5ed71e53b0..49e5950db5 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java @@ -25,16 +25,11 @@ import static org.testng.AssertJUnit.assertTrue; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/OpsRejectDistribution.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/OpsRejectDistribution.java index 2ac31183d3..989158ca1e 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/OpsRejectDistribution.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/OpsRejectDistribution.java @@ -20,15 +20,11 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.utils.CommonBeUtils; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; @@ -37,11 +33,8 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class OpsRejectDistribution extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/SearchFilterCategoryExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/SearchFilterCategoryExternalAPI.java index af4b9380fd..3f804a31b1 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/SearchFilterCategoryExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/SearchFilterCategoryExternalAPI.java @@ -20,13 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.Base64.Decoder; - -import javax.json.Json; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,75 +27,33 @@ import java.util.List; import java.util.Map; import java.util.Random; -import org.apache.cassandra.cli.CliParser.operator_return; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpResponseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.BasicResponseHandler; -import org.apache.http.util.EntityUtils; -import org.codehaus.jackson.map.ObjectMapper; -import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.graph.datatype.ActionEnum; import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.ArtifactUiDownloadData; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; -import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; -import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.DistributionNotificationStatusEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; -import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.SearchCriteriaEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit; -import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject; -import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils; -import org.openecomp.sdc.ci.tests.utils.validation.DistributionValidationUtils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; -import org.openecomp.sdc.common.api.ApplicationErrorCodesEnum; -import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; -import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.api.UploadArtifactInfo; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; -import org.openecomp.sdc.common.util.GeneralUtility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; @@ -110,20 +61,10 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import org.openecomp.sdc.utils.Pair; -import com.google.common.base.CaseFormat; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.relevantcodes.extentreports.LogStatus; - -import fj.P; -import fj.data.Either; -import it.unimi.dsi.fastutil.bytes.ByteSortedSets.SynchronizedSortedSet; - -import static java.util.Arrays.asList; public class SearchFilterCategoryExternalAPI extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java index 3264efb280..bb86f8f336 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import static org.testng.AssertJUnit.assertEquals; - import java.util.HashMap; import java.util.Map; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/VFCMTExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/VFCMTExternalAPI.java index 955b501db1..ce6103e7c2 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/VFCMTExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/VFCMTExternalAPI.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.ci.tests.execute.devCI; import static java.util.Arrays.asList; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -63,7 +62,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import com.google.common.util.concurrent.ListeningExecutorService; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java index 24c91935d4..d9548bd4f8 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ValidateConformanceLevel.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import org.junit.Rule; @@ -28,7 +27,6 @@ import org.junit.rules.TestName; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.utils.CommonBeUtils; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; @@ -40,8 +38,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class ValidateConformanceLevel extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java index be32d544ec..cd0332e768 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java @@ -20,10 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.devCI; -import static org.testng.AssertJUnit.assertNotNull; - -import java.io.IOException; -import java.text.ParseException; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -44,14 +40,11 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.DistributionUtils; import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.validation.DistributionValidationUtils; import org.testng.annotations.Test; -import org.openecomp.sdc.utils.DistributionStatusEnum; - import fj.data.Either; public class test1 extends ComponentBaseTest{ diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/UserAPIs.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/UserAPIs.java index 157f3157b8..3083188fa3 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/UserAPIs.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/UserAPIs.java @@ -20,7 +20,8 @@ package org.openecomp.sdc.ci.tests.execute.externalapi; -import static org.testng.AssertJUnit.*; +import static org.testng.AssertJUnit.assertFalse; +import static org.testng.AssertJUnit.assertTrue; import java.io.IOException; import java.lang.reflect.Type; @@ -47,18 +48,12 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.EcompUserRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils; -import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import fj.data.Either; - -import org.testng.Assert; - public class UserAPIs extends ComponentBaseTest { @Rule diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java index c52ee470cf..b820c7d803 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java @@ -52,7 +52,6 @@ import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java index 1551c99e66..12390eb2fc 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java @@ -35,7 +35,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedEcomConsumerAudit; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils; import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java index 2edd3284c4..828326e3da 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java @@ -26,8 +26,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.openecomp.sdc.ci.tests.utils.ToscaParserUtils.downloadAndParseToscaTemplate; -import java.io.ByteArrayInputStream; -import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -36,17 +34,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.stream.Collectors; import java.util.Optional; +import java.util.stream.Collectors; import org.apache.commons.codec.binary.Base64; import org.junit.Rule; import org.junit.rules.TestName; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.ArtifactUiDownloadData; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstInputsMap; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; @@ -68,10 +63,7 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.general.ImportUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.InputsRestUtils; @@ -83,7 +75,6 @@ import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils; import org.openecomp.sdc.common.api.Constants; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import org.yaml.snakeyaml.Yaml; import com.google.gson.Gson; import com.google.gson.JsonParser; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/FilteredDataByParamsComponentServletTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/FilteredDataByParamsComponentServletTest.java index e434f88ad5..c1b3181600 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/FilteredDataByParamsComponentServletTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/FilteredDataByParamsComponentServletTest.java @@ -22,28 +22,19 @@ package org.openecomp.sdc.ci.tests.execute.imports; import static org.testng.AssertJUnit.assertEquals; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import org.apache.commons.codec.binary.Base64; import org.junit.rules.TestName; -import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; import org.openecomp.sdc.be.ui.model.UiResourceDataTransfer; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.testng.annotations.Test; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java index f0421fb026..f3b134f6a9 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java @@ -39,8 +39,6 @@ import java.util.stream.Collectors; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.WordUtils; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.process.traversal.P; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -48,14 +46,12 @@ import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; @@ -82,7 +78,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; -import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.util.ValidationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -1502,8 +1497,8 @@ public class ImportCsarResourceTest extends ComponentBaseTest { String cp1Uid = nodes.get("cp1node").getUniqueId(); String cp2Uid = nodes.get("cp2node").getUniqueId(); Map> mappedByReqOwner = resource.getComponentInstancesRelations().stream().collect(Collectors.groupingBy(e -> e.getFromNode())); - assertEquals(mappedByReqOwner.get(cp1Uid).get(0).getRelationships().get(0).getCapabilityUid(), capabilities.get("virtual_linkable").getUniqueId()); - assertEquals(mappedByReqOwner.get(cp2Uid).get(0).getRelationships().get(0).getCapabilityUid(), capabilities.get("link").getUniqueId()); + assertEquals(mappedByReqOwner.get(cp1Uid).get(0).getRelationships().get(0).getRelation().getCapabilityUid(), capabilities.get("virtual_linkable").getUniqueId()); + assertEquals(mappedByReqOwner.get(cp2Uid).get(0).getRelationships().get(0).getRelation().getCapabilityUid(), capabilities.get("link").getUniqueId()); } @Test(enabled = true) diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java index 7957edc9a7..aa02a3e8c7 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java @@ -46,7 +46,6 @@ import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; - import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.model.LifecycleStateEnum; @@ -66,7 +65,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.execute.TODO.ImportCapabilityTypeCITest; import org.openecomp.sdc.ci.tests.utils.DbUtils; import org.openecomp.sdc.ci.tests.utils.Utils; -import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java index ef95b34198..7a8a764e2e 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java @@ -33,7 +33,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -48,11 +47,12 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.CapReqDef; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -94,8 +94,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import aj.org.objectweb.asm.Attribute; - /** * * @author Andrey + Pavel + Shay @@ -115,7 +113,6 @@ public class ImportToscaResourceTest extends ComponentBaseTest { protected static User testerUser; protected String testResourcesPath; protected ResourceReqDetails resourceDetails; - private HashSet capabilitySources; private int actualNumOfReqOrCap; @Rule @@ -130,7 +127,6 @@ public class ImportToscaResourceTest extends ComponentBaseTest { String sourceDir = config.getResourceConfigDir(); final String workDir = "importToscaResourceByCreateUrl"; testResourcesPath = sourceDir + File.separator + workDir; - capabilitySources = new HashSet(); actualNumOfReqOrCap = 0; } @@ -1341,7 +1337,7 @@ public class ImportToscaResourceTest extends ComponentBaseTest { requirementDef.setFromNode(riReq.getUniqueId()); requirementDef.setToNode(riCap.getUniqueId()); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(riReq.getUniqueId()); pair.setCapabilityOwnerId(riCap.getUniqueId()); pair.setRequirement("VirtualBinding"); @@ -1350,8 +1346,10 @@ public class ImportToscaResourceTest extends ComponentBaseTest { pair.setRelationships(relationship); pair.setCapabilityUid(capbilityUid); pair.setRequirementUid(requirementUid); - List relationships = new ArrayList<>(); - relationships.add(pair); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(pair); + List relationships = new ArrayList<>(); + relationships.add(capReqRel); requirementDef.setRelationships(relationships); RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncUserDetails, diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java index 464ebe12ed..9e8b94e5a8 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.ci.tests.execute.imports; import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.assertEquals; import java.nio.file.Files; import java.nio.file.Path; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ToscaTemplateVersionTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ToscaTemplateVersionTest.java index 1fbcd428ca..4a9e9beff4 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ToscaTemplateVersionTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ToscaTemplateVersionTest.java @@ -1,10 +1,14 @@ package org.openecomp.sdc.ci.tests.execute.imports; +import static org.junit.Assert.assertEquals; + +import java.nio.file.Paths; +import java.util.Map; + import org.junit.rules.TestName; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; @@ -20,12 +24,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.io.File; -import java.nio.file.Paths; -import java.util.Map; - -import static org.junit.Assert.assertEquals; - public class ToscaTemplateVersionTest extends ComponentBaseTest { private static final String EXPECTED_EXPORT_TOSCA_VERSION = "tosca_simple_yaml_1_1"; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java index c9aa44a6c0..fdde5e571a 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java @@ -49,7 +49,6 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.testng.annotations.BeforeMethod; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java index 6a5aeec5c9..9f0dff9b42 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java @@ -28,7 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.log4j.lf5.util.ResourceUtils; import org.json.simple.JSONObject; import org.json.simple.JSONValue; import org.junit.Rule; @@ -46,7 +45,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.preRequisites.SimpleOneRsrcOneServiceTest; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; @@ -57,8 +55,6 @@ import org.testng.AssertJUnit; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import com.google.gson.Gson; - public class PropertyApisTest extends SimpleOneRsrcOneServiceTest { protected static final String RESOURCE_CATEGORY = "Generic/Databases"; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java index 0ec6b00fdc..85dfe4e13a 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java @@ -25,7 +25,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.common.util.SerializationUtils; -import org.testng.annotations.Test; import fj.data.Either; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java index 4847491759..903ffbaca7 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java @@ -39,9 +39,10 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.CapReqDef; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -71,16 +72,12 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { private ResourceReqDetails resourceDetailsVF; private User designerUser; - private User adminUser; - private User testerUser; private ResourceReqDetails resourceDetailsReq; private ResourceReqDetails resourceDetailsCap; @BeforeMethod public void before() throws Exception { designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); - adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN); - testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER); resourceDetailsVF = ElementFactory.getDefaultResourceByType("VF100", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, designerUser.getUserId(), ResourceTypeEnum.VF.toString()); @@ -119,7 +116,7 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { requirementDef.setFromNode(riReq.getUniqueId()); requirementDef.setToNode(riCap.getUniqueId()); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(riReq.getUniqueId()); pair.setCapabilityOwnerId(riCap.getUniqueId()); pair.setRequirement("host"); @@ -128,8 +125,10 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { pair.setRelationships(relationship); pair.setCapabilityUid(capbilityUid); pair.setRequirementUid(requirementUid); - List relationships = new ArrayList<>(); - relationships.add(pair); + List relationships = new ArrayList<>(); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(pair); + relationships.add(capReqRel); requirementDef.setRelationships(relationships); return requirementDef; } @@ -179,7 +178,7 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { requirementDef.setFromNode(riReq.getUniqueId()); requirementDef.setToNode(riCap.getUniqueId()); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(riReq.getUniqueId()); pair.setCapabilityOwnerId(riCap.getUniqueId()); pair.setRequirement("host"); @@ -188,8 +187,10 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { pair.setRelationships(relationship); pair.setCapabilityUid(capList.get(0).getUniqueId()); pair.setRequirementUid(reqList.get(0).getUniqueId()); - List relationships = new ArrayList<>(); - relationships.add(pair); + List relationships = new ArrayList<>(); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(pair); + relationships.add(capReqRel); requirementDef.setRelationships(relationships); RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser, @@ -367,10 +368,8 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { public void associateCpToVfTest() throws Exception { createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString()); - ComponentInstance riCapInVfInstance = createComponentInstance(resourceDetailsCap, designerUser, - resourceDetailsVF); - ComponentInstance riReqInVfInstance = createComponentInstance(resourceDetailsReq, designerUser, - resourceDetailsVF); + createComponentInstance(resourceDetailsCap, designerUser, resourceDetailsVF); + createComponentInstance(resourceDetailsReq, designerUser, resourceDetailsVF); ResourceReqDetails vfHigh = new ResourceReqDetails(resourceDetailsVF, "0.1"); vfHigh.setName("vfHigh"); @@ -510,10 +509,6 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { ComponentInstance riCap = createComponentInstance(resourceDetailsCap); CapReqDef capReqDefBeforeAssociate = getResourceReqCap(); - Map> capabilitiesBeforeAssociate = capReqDefBeforeAssociate - .getCapabilities(); - Map> requirementsBeforeAssociate = capReqDefBeforeAssociate - .getRequirements(); RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap, capReqDefBeforeAssociate); @@ -544,10 +539,6 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { ComponentInstance riCap = createComponentInstance(resourceDetailsCap); CapReqDef capReqDefBeforeAssociate = getResourceReqCap(); - Map> capabilitiesBeforeAssociate = capReqDefBeforeAssociate - .getCapabilities(); - Map> requirementsBeforeAssociate = capReqDefBeforeAssociate - .getRequirements(); RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap, capReqDefBeforeAssociate); @@ -979,7 +970,7 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap, capReqDefBeforeAssociate); assertTrue(requirementDef.getRelationships().size() == 1); - String requirement = requirementDef.getRelationships().get(0).getRequirement(); + String requirement = requirementDef.getRelationships().get(0).getRelation().getRequirement(); RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE); assertEquals("Check response code ", 404, associateInstances.getErrorCode().intValue()); @@ -1122,7 +1113,7 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { .getCapabilities(); Map> requirementsBeforeAssociate = capReqDefBeforeAssociate .getRequirements(); - String requirementName = requirementDef.getRelationships().get(0).getRequirement(); + String requirementName = requirementDef.getRelationships().get(0).getRelation().getRequirement(); RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE); @@ -1152,10 +1143,6 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap, capReqDefBeforeAssociate); - Map> capabilitiesBeforeAssociate = capReqDefBeforeAssociate - .getCapabilities(); - Map> requirementsBeforeAssociate = capReqDefBeforeAssociate - .getRequirements(); String uidNotFound = "123"; RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser, @@ -1326,7 +1313,7 @@ public class ComponentRelationshipInVfTest extends ComponentBaseTest { Map> requirementsBeforeAssociate = capReqDefBeforeAssociate .getRequirements(); - RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser, + ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE); RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceDetailsCap.getUniqueId(), diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java index f4e51b14d9..b2e81fea75 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.ci.tests.execute.resource; import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; import java.util.ArrayList; import java.util.Arrays; @@ -31,18 +30,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.AssertTrue; - -import org.apache.log4j.lf5.util.ResourceUtils; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.api.Urls; @@ -52,7 +46,6 @@ import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; @@ -65,7 +58,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; import org.openecomp.sdc.ci.tests.utils.Utils; -import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.Convertor; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; @@ -78,7 +70,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils; -import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.Test; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java index 25c3242d2c..a3372098a0 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import org.apache.log4j.lf5.util.ResourceUtils; import org.junit.rules.TestName; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; @@ -38,7 +37,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetLeftPaletteTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetLeftPaletteTest.java index 4ad008633a..b6d9058c92 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetLeftPaletteTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetLeftPaletteTest.java @@ -1,5 +1,10 @@ package org.openecomp.sdc.ci.tests.execute.resource; +import static org.testng.AssertJUnit.assertTrue; + +import java.io.IOException; +import java.util.Arrays; + import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; @@ -19,15 +24,10 @@ import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import java.io.IOException; -import java.util.Arrays; - -import static org.testng.AssertJUnit.assertTrue; - /** * Created by chaya on 6/15/2017. */ diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java index cdb7dc0304..cdfd3ec650 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java @@ -30,7 +30,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.log4j.lf5.util.ResourceUtils; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.model.User; @@ -45,7 +44,6 @@ import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.execute.imports.ImportGenericResourceCITest; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.slf4j.Logger; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java index feb7b6f42e..df8ff58ba8 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java @@ -33,7 +33,6 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import org.apache.log4j.lf5.util.ResourceUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java index da5b469a4f..5b68b0fa84 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java @@ -40,7 +40,6 @@ import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java index 59050103ca..895390f764 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java @@ -57,7 +57,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import com.google.gson.Gson; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java index 8a17c3c115..37e7539fd9 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.ci.tests.execute.resource; import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; -import java.io.IOException; import java.util.List; import org.json.simple.JSONArray; @@ -32,8 +31,6 @@ import org.json.simple.JSONValue; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; @@ -46,7 +43,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java index ea8b89200e..dddab57873 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java @@ -40,10 +40,11 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.CapReqDef; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -1686,7 +1687,7 @@ public class VfComponentInstanceCRUDTest extends ComponentInstanceBaseTest { requirementDef.setFromNode(riReq.getUniqueId()); requirementDef.setToNode(riCap.getUniqueId()); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(riReq.getUniqueId()); pair.setCapabilityOwnerId(riCap.getUniqueId()); pair.setRequirement("host"); @@ -1695,8 +1696,10 @@ public class VfComponentInstanceCRUDTest extends ComponentInstanceBaseTest { pair.setRelationships(relationship); pair.setCapabilityUid(capList.get(0).getUniqueId()); pair.setRequirementUid(reqList.get(0).getUniqueId()); - List relationships = new ArrayList<>(); - relationships.add(pair); + List relationships = new ArrayList<>(); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + relationships.add(capReqRel); + capReqRel.setRelation(pair); requirementDef.setRelationships(relationships); RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java index 3d338534d1..c8a20cf44a 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java @@ -32,7 +32,6 @@ import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.DistributionStatusEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; @@ -45,7 +44,6 @@ import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; @@ -61,8 +59,6 @@ import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import fj.data.Either; - public class ChangeServiceDistributionStatusApiTest extends ComponentBaseTest { protected ResourceReqDetails resourceDetails; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java index 8e95a6d02c..56cfeb54ea 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.ci.tests.execute.service; -import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotNull; @@ -37,7 +36,6 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.LifecycleStateEnum; -import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; @@ -49,7 +47,6 @@ import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; @@ -63,7 +60,6 @@ import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java index 3460cd6e04..760d002856 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java @@ -28,7 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.cassandra.transport.Event.SchemaChange.Target; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java index 5642ce4745..846b5d24d3 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java @@ -27,10 +27,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.apache.http.HttpStatus; -import org.apache.log4j.lf5.util.ResourceUtils; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; @@ -67,7 +65,6 @@ import org.testng.annotations.Test; import com.google.gson.JsonArray; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import fj.data.Either; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java index 55ecf694ee..19bed4d380 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java @@ -46,7 +46,6 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java index c21deafcd8..fdec8346fc 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java @@ -39,10 +39,11 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.CapReqDef; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -1045,7 +1046,7 @@ public class ReqCapOccurrencesTest extends ComponentInstanceBaseTest { requirementDef.setFromNode(riReq.getUniqueId()); requirementDef.setToNode(riCap.getUniqueId()); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(riReq.getUniqueId()); pair.setCapabilityOwnerId(riCap.getUniqueId()); pair.setRequirement("host"); @@ -1054,8 +1055,10 @@ public class ReqCapOccurrencesTest extends ComponentInstanceBaseTest { pair.setRelationships(relationship); pair.setCapabilityUid(capbilityUid); pair.setRequirementUid(requirementUid); - List relationships = new ArrayList<>(); - relationships.add(pair); + List relationships = new ArrayList<>(); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + relationships.add(capReqRel); + capReqRel.setRelation(pair); requirementDef.setRelationships(relationships); return requirementDef; } diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java index 2939a8a09e..ce2c996cc6 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java @@ -34,9 +34,14 @@ import org.json.JSONArray; import org.junit.rules.TestName; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.CapReqDef; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest; -import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails; @@ -44,10 +49,8 @@ import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java index 1865dc3292..def34958eb 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java @@ -45,7 +45,6 @@ import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; @@ -523,6 +522,15 @@ public class UpdateServiceMetadataTest extends ComponentBaseTest { getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); } + @Test + public void environmentContextService() throws Exception { + updatedServiceDetails.setEnvironmentContext("General_Revenue-Bearing"); + RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails); + validateResponse(updateServiceResponse, 200, null, listForMessage); + Service actualService = ResponseParser.convertServiceResponseToJavaObject(updateServiceResponse.getResponse()); + assertEquals(updatedServiceDetails.getEnvironmentContext(), actualService.getEnvironmentContext()); + } + // TODO Irrelevant @Test(enabled = false) public void missingProjectCodeTest1() throws Exception { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java index 9a7f68264f..7d0ef75cf5 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java @@ -47,9 +47,7 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest; import org.openecomp.sdc.ci.tests.utils.DbUtils; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/CommonMigrationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/CommonMigrationUtils.java index 41a4eb0f3b..809a51c2ff 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/CommonMigrationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/CommonMigrationUtils.java @@ -20,11 +20,11 @@ package org.openecomp.sdc.ci.tests.migration.v1707; -import com.thinkaurelius.titan.core.TitanGraph; - import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; +import com.thinkaurelius.titan.core.TitanGraph; + public class CommonMigrationUtils { public static void assertKeyNotExist(TitanGraph graph, String key) { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/postupgrade/AttKeyPropertiesRenameTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/postupgrade/AttKeyPropertiesRenameTest.java index 18ade957cf..4ae4c17bea 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/postupgrade/AttKeyPropertiesRenameTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/postupgrade/AttKeyPropertiesRenameTest.java @@ -20,7 +20,16 @@ package org.openecomp.sdc.ci.tests.migration.v1707.postupgrade; -import com.thinkaurelius.titan.core.TitanVertex; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; @@ -28,12 +37,7 @@ import org.openecomp.sdc.ci.tests.migration.v1707.CommonMigrationUtils; import org.openecomp.sdc.ci.tests.utils.graph.GraphFileUtils; import org.testng.annotations.Test; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static org.testng.Assert.*; +import com.thinkaurelius.titan.core.TitanVertex; public class AttKeyPropertiesRenameTest extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/preupgrade/AttKeyPropertiesBeforeRenameTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/preupgrade/AttKeyPropertiesBeforeRenameTest.java index 81fe8b4acf..4369d75a74 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/preupgrade/AttKeyPropertiesBeforeRenameTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/migration/v1707/preupgrade/AttKeyPropertiesBeforeRenameTest.java @@ -20,7 +20,10 @@ package org.openecomp.sdc.ci.tests.migration.v1707.preupgrade; -import com.thinkaurelius.titan.core.TitanVertex; +import static org.testng.Assert.assertTrue; + +import java.io.IOException; + import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; @@ -28,9 +31,7 @@ import org.openecomp.sdc.ci.tests.migration.v1707.CommonMigrationUtils; import org.openecomp.sdc.ci.tests.utils.graph.GraphFileUtils; import org.testng.annotations.Test; -import java.io.IOException; - -import static org.testng.Assert.assertTrue; +import com.thinkaurelius.titan.core.TitanVertex; public class AttKeyPropertiesBeforeRenameTest extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java index 0a7b4a98aa..1cc4626f49 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java @@ -20,14 +20,14 @@ package org.openecomp.sdc.ci.tests.sanity; +import static org.testng.AssertJUnit.assertTrue; + import java.util.ArrayList; import java.util.List; -import java.util.Map; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; @@ -43,7 +43,6 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils; import org.testng.annotations.Test; -import static org.testng.AssertJUnit.assertTrue; public class MultipleResourceUpdate extends ComponentBaseTest { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java index de7fd7eaf7..41aa1a567f 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java @@ -29,7 +29,15 @@ import java.util.Map.Entry; import java.util.Set; import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.util.ElementHelper; +import org.openecomp.sdc.ci.tests.api.Urls; +import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject; +import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -43,19 +51,6 @@ import com.thinkaurelius.titan.core.TitanVertex; import fj.data.Either; -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Edge; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.util.ElementHelper; -import org.openecomp.sdc.ci.tests.api.Urls; -import org.openecomp.sdc.ci.tests.config.Config; -import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; -import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject; -import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils; -import org.apache.tinkerpop.gremlin.structure.Element; -import org.apache.tinkerpop.gremlin.structure.Property; - public class DbUtils { private static String titanConfigFilePath; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java index 66d2a8450c..66379f18ef 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java @@ -42,7 +42,7 @@ import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Product; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -580,7 +580,7 @@ public class ReqCap { private static void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) { // removing from requirements - RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0); + RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation(); String type = relationship.getRelationship().getType(); String fromId = requirementDef.getFromNode(); List reqList = expectedContainerRequirements.get(type); @@ -612,7 +612,7 @@ public class ReqCap { private static void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) { // adding to requirements - RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0); + RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation(); String type = relationship.getRelationship().getType(); String fromId = requirementDef.getFromNode(); String key = type + " " + fromId; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java index 832ebdf4b9..b6cc44ce36 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java @@ -20,10 +20,10 @@ package org.openecomp.sdc.ci.tests.utils.cassandra; -import com.datastax.driver.core.*; -import com.datastax.driver.core.querybuilder.QueryBuilder; -import com.datastax.driver.core.querybuilder.Select; -import com.datastax.driver.core.querybuilder.Select.Where; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import org.javatuples.Pair; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; @@ -32,10 +32,15 @@ import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.KeyspaceMetadata; +import com.datastax.driver.core.Metadata; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import com.datastax.driver.core.TableMetadata; +import com.datastax.driver.core.querybuilder.QueryBuilder; +import com.datastax.driver.core.querybuilder.Select; +import com.datastax.driver.core.querybuilder.Select.Where; public final class CassandraUtils { private static Logger logger = LoggerFactory.getLogger(CassandraUtils.class.getName()); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java index cafdab7d8f..05336c475b 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java @@ -20,10 +20,10 @@ package org.openecomp.sdc.ci.tests.utils.cassandra; -import com.datastax.driver.core.*; -import com.datastax.driver.core.querybuilder.QueryBuilder; -import com.datastax.driver.core.querybuilder.Select; -import com.datastax.driver.core.querybuilder.Select.Where; +import java.io.FileNotFoundException; +import java.util.Collection; +import java.util.List; + import org.javatuples.Pair; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import org.openecomp.sdc.ci.tests.utils.Utils; @@ -31,9 +31,15 @@ import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.FileNotFoundException; -import java.util.Collection; -import java.util.List; +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.KeyspaceMetadata; +import com.datastax.driver.core.Metadata; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import com.datastax.driver.core.TableMetadata; +import com.datastax.driver.core.querybuilder.QueryBuilder; +import com.datastax.driver.core.querybuilder.Select; +import com.datastax.driver.core.querybuilder.Select.Where; public final class CassandraUtils2 { private static Logger logger = LoggerFactory.getLogger(CassandraUtils2.class.getName()); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java index 79dea07c44..a9b8aaea15 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java @@ -29,7 +29,6 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.model.DistributionStatusEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Product; import org.openecomp.sdc.be.model.User; @@ -40,12 +39,10 @@ import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; -import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject; import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; import org.openecomp.sdc.common.api.Constants; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java index 1578b6eba0..076261adef 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java @@ -33,10 +33,11 @@ import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -51,7 +52,6 @@ import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails; import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure; import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; @@ -71,8 +71,6 @@ import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.util.ValidationUtils; -import com.google.common.base.CaseFormat; - public class ElementFactory { private static final String JH0003 = "jh0003"; @@ -915,7 +913,7 @@ public class ElementFactory { RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef(); requirementDef.setFromNode(fromCompInstId); requirementDef.setToNode(toCompInstId); - RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair(); + RelationshipInfo pair = new RelationshipInfo(); pair.setRequirementOwnerId(reqOwnerId); pair.setCapabilityOwnerId(capOwnerId); pair.setRequirement(reqCapName); @@ -924,8 +922,10 @@ public class ElementFactory { pair.setRelationships(relationship); pair.setCapabilityUid(capList.get(0).getUniqueId()); pair.setRequirementUid(reqList.get(0).getUniqueId()); - List relationships = new ArrayList<>(); - relationships.add(pair); + List relationships = new ArrayList<>(); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + relationships.add(capReqRel); + capReqRel.setRelation(pair); requirementDef.setRelationships(relationships); return requirementDef; } diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java index c1f311a91e..7e5a7d69a2 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java @@ -20,16 +20,10 @@ package org.openecomp.sdc.ci.tests.utils.general; -import java.io.File; import java.io.IOException; import java.util.List; -import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; -import org.openecomp.sdc.ci.tests.utils.Utils; public class ImportUtils { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/graph/GraphFileUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/graph/GraphFileUtils.java index 91e7a3fae9..00c51f8fbd 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/graph/GraphFileUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/graph/GraphFileUtils.java @@ -20,10 +20,6 @@ package org.openecomp.sdc.ci.tests.utils.graph; -import com.thinkaurelius.titan.core.TitanVertex; -import org.apache.commons.io.FileUtils; -import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; - import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; @@ -32,6 +28,11 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; +import org.apache.commons.io.FileUtils; +import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; + +import com.thinkaurelius.titan.core.TitanVertex; + public class GraphFileUtils { public static final String TEMP_FILES_PATH = "src/main/resources/ci/tempFiles/%s.txt"; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java index 5565780dd5..7cee913b0d 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java @@ -24,7 +24,6 @@ import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; import java.io.IOException; -import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -44,7 +43,6 @@ import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; -import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ArtifactAssetStructure; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java index 522a91f7d3..528e82a9f5 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java @@ -21,7 +21,11 @@ package org.openecomp.sdc.ci.tests.utils.rest; import java.io.IOException; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CommonRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CommonRestUtils.java index bc807df7fa..e691efdbca 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CommonRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CommonRestUtils.java @@ -2,12 +2,11 @@ package org.openecomp.sdc.ci.tests.utils.rest; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; - public class CommonRestUtils extends BaseRestUtils { private static Logger logger = LoggerFactory.getLogger(CommonRestUtils.class.getName()); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java index 9755ff2d91..407141622e 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Properties; import org.apache.commons.io.IOUtils; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java index ebc80ae537..fad47f0178 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java @@ -22,8 +22,6 @@ package org.openecomp.sdc.ci.tests.utils.rest; import java.io.IOException; -import com.google.gson.Gson; - import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Product; @@ -39,6 +37,8 @@ import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.gson.Gson; + public class ProductRestUtils extends BaseRestUtils { private static Gson gson = new Gson(); private static Logger logger = LoggerFactory.getLogger(ProductRestUtils.class.getName()); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java index a47477f363..0d8a1119ad 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java @@ -59,13 +59,13 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.common.util.GeneralUtility; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ResourceRestUtils extends BaseRestUtils { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java index 19d7d728fe..d9b8ec3d4b 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java @@ -26,7 +26,6 @@ import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.Urls; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java index 6ffb2b29b5..2d173cc151 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java @@ -31,10 +31,8 @@ import java.util.Map; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; -import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.Version; import org.codehaus.jackson.map.JsonDeserializer; -import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.module.SimpleModule; import org.json.JSONArray; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java index f3240684cb..50ecdd8520 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java @@ -44,9 +44,7 @@ import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.general.FileUtils; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; -import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonParser; public class ArtifactValidationUtils { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java index 0d49d97302..eb3ee331ed 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java @@ -28,7 +28,6 @@ import java.util.Arrays; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; -import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.openecomp.sdc.exception.ResponseFormat; import org.testng.Assert; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java index d63a514b3a..cd2297fd19 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java @@ -20,9 +20,10 @@ package org.openecomp.sdc.ci.tests.utils.validation; +import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; -import static org.testng.AssertJUnit.assertEquals; + import org.json.JSONObject; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.GroupingDefinition; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java index 94dcca7edf..9bf8bd9230 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java @@ -29,7 +29,6 @@ import java.io.InputStream; import java.util.List; import java.util.Map; -import org.yaml.snakeyaml.Yaml; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import org.openecomp.sdc.ci.tests.config.Config; @@ -38,6 +37,7 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.ExceptionEnumType; import org.openecomp.sdc.ci.tests.utils.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.Yaml; public class ErrorValidationUtils { diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java index a7c7b7d34e..2f8a0dffc4 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java @@ -20,8 +20,9 @@ package org.openecomp.sdc.ci.tests.utils.validation; -import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertFalse; + import java.util.LinkedHashSet; import java.util.List; import java.util.Set; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/TestYamlParser.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/TestYamlParser.java index 223bf4ed4b..dde27d5cbd 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/TestYamlParser.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/TestYamlParser.java @@ -31,9 +31,7 @@ import java.util.Set; import org.junit.Rule; import org.junit.rules.TestName; -import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition; import org.openecomp.sdc.common.util.ZipUtil; import org.testng.annotations.Test; import org.yaml.snakeyaml.Yaml; diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java index 9c44aa55ef..31e2327e40 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java @@ -20,8 +20,8 @@ package org.openecomp.sdc.ci.tests.utils.validation; -import static org.testng.AssertJUnit.assertTrue; import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertTrue; import java.util.List; diff --git a/asdctool/pom.xml b/asdctool/pom.xml index 6ec6645b8b..f4918fd954 100644 --- a/asdctool/pom.xml +++ b/asdctool/pom.xml @@ -516,8 +516,7 @@ org.mockito - mockito-all - ${mockito.version} + mockito-core test @@ -525,6 +524,7 @@ + ${project.artifactId}-${project.version}-jar-with-dependencies @@ -539,19 +539,7 @@ org.apache.maven.plugins maven-assembly-plugin - - - create.jar.with.dependencies - package - - single - - - - jar-with-dependencies - - - + sdctool @@ -559,7 +547,7 @@ ${project.basedir}/tarball.xml assemble-file - package + install single @@ -567,32 +555,89 @@ + + + org.apache.maven.plugins + maven-shade-plugin + 3.1.0 + + + package + + shade + + + + + org.openecomp.sdc:* + + **/elasticsearch.yml + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + + maven-clean-plugin + 3.0.0 + + + clean-static-files + clean + + clean + + + + + + ${project.parent.basedir}/asdctool/tosca + false + + + + + + + org.apache.maven.plugins maven-resources-plugin 3.0.2 - - - - copy-sdctool - install - - copy-resources - - - ${project.parent.basedir}/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default - - - ./target - - sdctool.tar - - - - - - + + + copy-tosca-folder + + compile + + copy-resources + + + ${project.parent.basedir}/asdctool/tosca + + + ${project.parent.basedir}/catalog-be/src/main/resources/import/tosca + true + + + + + diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfiguration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfiguration.java new file mode 100644 index 0000000000..f14196681e --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfiguration.java @@ -0,0 +1,327 @@ +package org.openecomp.sdc.asdctool.configuration; + +import org.openecomp.sdc.asdctool.impl.ArtifactUuidFix; +import org.openecomp.sdc.be.auditing.impl.AuditingManager; +import org.openecomp.sdc.be.components.ArtifactsResolver; +import org.openecomp.sdc.be.components.distribution.engine.DistributionEngine; +import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder; +import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic; +import org.openecomp.sdc.be.components.impl.ArtifactResolverImpl; +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; +import org.openecomp.sdc.be.components.impl.CompositionBusinessLogic; +import org.openecomp.sdc.be.components.impl.GroupBusinessLogic; +import org.openecomp.sdc.be.components.impl.InputsBusinessLogic; +import org.openecomp.sdc.be.components.impl.ProductBusinessLogic; +import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; +import org.openecomp.sdc.be.components.impl.ResourceImportManager; +import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; +import org.openecomp.sdc.be.components.impl.ServiceComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.VFComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; +import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; +import org.openecomp.sdc.be.components.merge.heat.HeatEnvArtifactsMergeBusinessLogic; +import org.openecomp.sdc.be.components.merge.input.InputsValuesMergingBusinessLogic; +import org.openecomp.sdc.be.components.merge.instance.ComponentInstanceMergeDataBusinessLogic; +import org.openecomp.sdc.be.components.merge.property.DataDefinitionsValuesMergingBusinessLogic; +import org.openecomp.sdc.be.dao.DAOTitanStrategy; +import org.openecomp.sdc.be.dao.TitanClientStrategy; +import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao; +import org.openecomp.sdc.be.dao.cassandra.CassandraClient; +import org.openecomp.sdc.be.dao.config.DAOSpringConfig; +import org.openecomp.sdc.be.dao.es.ElasticSearchClient; +import org.openecomp.sdc.be.dao.impl.AuditingDao; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.titan.TitanGenericDao; +import org.openecomp.sdc.be.dao.titan.TitanGraphClient; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.cache.ComponentCache; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation; +import org.openecomp.sdc.be.model.operations.impl.ComponentInstanceOperation; +import org.openecomp.sdc.be.model.operations.impl.CsarOperation; +import org.openecomp.sdc.be.model.operations.impl.ElementOperation; +import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupInstanceOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupTypeOperation; +import org.openecomp.sdc.be.model.operations.impl.PropertyOperation; +import org.openecomp.sdc.be.tosca.CsarUtils; +import org.openecomp.sdc.be.tosca.ToscaExportHandler; +import org.openecomp.sdc.be.user.UserBusinessLogic; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.config.PropertiesFactoryBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.core.io.FileSystemResource; + +@Configuration +@Import(DAOSpringConfig.class) +@ComponentScan({ + "org.openecomp.sdc.be.model.operations.impl", + "org.openecomp.sdc.be.model.cache", + "org.openecomp.sdc.be.dao.titan", + "org.openecomp.sdc.be.dao.cassandra", + "org.openecomp.sdc.be.model.jsontitan.operations", + "org.openecomp.sdc.be.dao.jsongraph", + "org.openecomp.sdc.be.tosca", + "org.openecomp.sdc.be.components.merge", + }) +public class ArtifactUUIDFixConfiguration { + + @Bean + public ArtifactUuidFix artifactUuidFix() { + return new ArtifactUuidFix(); + } + + @Bean(name = "cassandra-client") + public CassandraClient cassandraClient() { + return new CassandraClient(); + } + + + @Bean(name = "dao-titan-strategy") + public TitanClientStrategy daoStrategy() { + return new DAOTitanStrategy(); + } + + @Bean(name = "titan-dao") + public TitanDao titanDao(@Qualifier("titan-client") TitanGraphClient titanGraphClient) { + return new TitanDao(titanGraphClient); + } + + @Bean(name = "titan-client", initMethod = "createGraph") + public TitanGraphClient titanClient(@Qualifier("dao-titan-strategy") TitanClientStrategy titanClientStrategy) { + return new TitanGraphClient(titanClientStrategy); + } + + @Bean(name = "resource-business-logic") + public ResourceBusinessLogic resourceBusinessLogic() { + return new ResourceBusinessLogic(); + } + +// @Bean(name = "healthCheckBusinessLogic") +// public HealthCheckBusinessLogic healthCheckBusinessLogic() { +// return new HealthCheckBusinessLogic(); +// } +// +// @Bean(name = "distribution-engine-cluster-health") +// public DistributionEngineClusterHealth distributionEngineClusterHealth() { +// return new DistributionEngineClusterHealth(); +// } +// +// @Bean(name = "cassandra-health-check") +// public CassandraHealthCheck cassandraHealthCheck() { +// return new CassandraHealthCheck(); +// } + +// @Bean(name = "switchover-detector") +// public SwitchoverDetector switchoverDetector() { +// return new SwitchoverDetector(); +// } + + @Bean(name = "service-business-logic") + public ServiceBusinessLogic serviceBusinessLogic() { + return new ServiceBusinessLogic(); + } + + @Bean(name = "capability-type-operation") + public CapabilityTypeOperation CapabilityTypeOperation() { + return new CapabilityTypeOperation(); + } + + @Bean(name = "lifecycle-business-logic") + public LifecycleBusinessLogic lifecycleBusinessLogic() { + return new LifecycleBusinessLogic(); + } + + @Bean(name = "property-operation") + public PropertyOperation propertyOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao) { + return new PropertyOperation(titanGenericDao); + } + + @Bean(name = "csar-operation") + public CsarOperation csarOperation() { + return new CsarOperation(); + } + + @Bean(name = "vf-component-instance-business-logic") + public VFComponentInstanceBusinessLogic vFComponentInstanceBusinessLogic() { + return new VFComponentInstanceBusinessLogic(); + } + + @Bean(name = "resource-import-manager") + public ResourceImportManager resourceImportManager() { + return new ResourceImportManager(); + } + + @Bean(name = "group-business-logic") + public GroupBusinessLogic groupBusinessLogic() { + return new GroupBusinessLogic(); + } + + @Bean(name = "inputs-business-logic") + public InputsBusinessLogic inputsBusinessLogic() { + return new InputsBusinessLogic(); + } + + @Bean(name = "composition-business-logic") + public CompositionBusinessLogic compositionBusinessLogic() { + return new CompositionBusinessLogic(); + } + + @Bean(name = "artifacts-business-logic") + public ArtifactsBusinessLogic artifactsBusinessLogic() { + return new ArtifactsBusinessLogic(); + } + + @Bean(name = "component-cache") + public ComponentCache componentCache() { + return new ComponentCache(); + } + + @Bean(name = "componentUtils") + public ComponentsUtils componentsUtils() { + return new ComponentsUtils(); + } + + @Bean(name = "user-business-logic") + public UserBusinessLogic userBusinessLogic() { + return new UserBusinessLogic(); + } + + @Bean(name = "graph-lock-operation") + public GraphLockOperation graphLockOperation() { + return new GraphLockOperation(); + } + + @Bean(name = "titan-generic-dao") + public TitanGenericDao titanGenericDao(@Qualifier("titan-client") TitanGraphClient titanGraphClient) { + return new TitanGenericDao(titanGraphClient); + } + + @Bean(name = "element-operation") + public ElementOperation elementOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao) { + return new ElementOperation(titanGenericDao); + } + + @Bean(name = "group-operation") + public GroupOperation groupOperation() { + return new GroupOperation(); + } + + @Bean(name = "group-instance-operation") + public GroupInstanceOperation groupInstanceOperation() { + return new GroupInstanceOperation(); + } + + @Bean(name = "group-type-operation") + public GroupTypeOperation groupTypeOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao, @Qualifier("property-operation") PropertyOperation propertyOperation) { + return new GroupTypeOperation(titanGenericDao, propertyOperation); + } + + @Bean(name = "tosca-operation-facade") + public ToscaOperationFacade toscaOperationFacade() { + return new ToscaOperationFacade(); + } + + @Bean(name = "distribution-engine") + public DistributionEngine distributionEngine() { + return null; + } + + @Bean(name = "audit-cassandra-dao") + public AuditCassandraDao auditCassandraDao() { + return new AuditCassandraDao(); + } + + @Bean(name = "service-component-instance-business-logic") + public ServiceComponentInstanceBusinessLogic serviceComponentInstanceBusinessLogic() { + return new ServiceComponentInstanceBusinessLogic(); + } + + @Bean("tosca-export-handler") + public ToscaExportHandler toscaExportHandler() { + return new ToscaExportHandler(); + } + + @Bean(name = "component-instance-operation") + public ComponentInstanceOperation componentInstanceOperation() { + return new ComponentInstanceOperation(); + } + + @Bean(name = "additional-information-business-logic") + public AdditionalInformationBusinessLogic additionalInformationBusinessLogic() { + return new AdditionalInformationBusinessLogic(); + } + + @Bean(name = "auditing-manager") + public AuditingManager auditingManager() { + return new AuditingManager(); + } + + @Bean(name = "auditing-dao") + public AuditingDao auditingDao() { + return new AuditingDao(); + } + + @Bean(name = "elasticsearch-client", initMethod = "initialize") + public ElasticSearchClient elasticSearchClient() { + return new ElasticSearchClient(); + } + + @Bean(name = "csar-utils") + public CsarUtils csarUtils() { + return new CsarUtils(); + } + + @Bean(name = "service-distribution-artifacts-builder") + public ServiceDistributionArtifactsBuilder serviceDistributionArtifactsBuilder() { + return new ServiceDistributionArtifactsBuilder(); + } + + @Bean(name = "product-business-logic") + public ProductBusinessLogic productBusinessLogic() { + return null; + } + + @Bean(name = "dataDefinitionsValuesMergingBusinessLogic") + public DataDefinitionsValuesMergingBusinessLogic dataDefinitionsValuesMergingBusinessLogic() { + return new DataDefinitionsValuesMergingBusinessLogic(); + } + + @Bean(name = "artifacts-resolver") + public ArtifactsResolver artifactsResolver() { + return new ArtifactResolverImpl(); + } + + @Bean(name = "InputsValuesMergingBusinessLogic") + public InputsValuesMergingBusinessLogic InputsValuesMergingBusinessLogic(){ + return new InputsValuesMergingBusinessLogic(); + } + + @Bean(name = "GenericTypeBusinessLogic") + public GenericTypeBusinessLogic genericTypeBusinessLogic(){ + return new GenericTypeBusinessLogic(); + } + + @Bean(name ="componentInstanceMergeDataBusinessLogic") + public ComponentInstanceMergeDataBusinessLogic componentInstanceMergeDataBusinessLogic(){ + return new ComponentInstanceMergeDataBusinessLogic(); + } + + @Bean(name ="heatEnvArtifactsMergeBusinessLogic") + public HeatEnvArtifactsMergeBusinessLogic heatEnvArtifactsMergeBusinessLogic(){ + return new HeatEnvArtifactsMergeBusinessLogic(); + } + + @Bean(name = "elasticsearchConfig") + public PropertiesFactoryBean mapper() { + String configHome = System.getProperty("config.home"); + PropertiesFactoryBean bean = new PropertiesFactoryBean(); + bean.setLocation(new FileSystemResource(configHome + "/elasticsearch.yml")); + return bean; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java new file mode 100644 index 0000000000..267f20904c --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java @@ -0,0 +1,28 @@ +package org.openecomp.sdc.asdctool.configuration; + +import java.io.File; + +import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.impl.FSConfigurationSource; + +public class ConfigurationUploader { + + public static void uploadConfigurationFiles(String appConfigDir) { + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + new ConfigurationManager(configurationSource); + ExternalConfiguration.setAppVersion(ConfigurationManager.getConfigurationManager().getConfiguration().getAppVersion()); + System.setProperty("config.home", appConfigDir); + System.setProperty("artifactgenerator.config", buildArtifactGeneratorPath(appConfigDir)); + } + + private static String buildArtifactGeneratorPath(String appConfigDir) { + StringBuilder artifactGeneratorPath = new StringBuilder(appConfigDir); + if(!appConfigDir.endsWith(File.separator)){ + artifactGeneratorPath.append(File.separator); + } + artifactGeneratorPath.append(ConfigurationManager.getConfigurationManager().getConfiguration().getArtifactGeneratorConfig()); + return artifactGeneratorPath.toString(); + } +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java new file mode 100644 index 0000000000..1328f3f51b --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java @@ -0,0 +1,1202 @@ +package org.openecomp.sdc.asdctool.impl; + +import java.io.BufferedWriter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Collections; +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; + +import org.openecomp.sdc.be.components.distribution.engine.VfModuleArtifactPayload; +import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.DistributionStatusEnum; +import org.openecomp.sdc.be.model.GroupDefinition; +import org.openecomp.sdc.be.model.GroupInstance; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; +import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.resources.data.ESArtifactData; +import org.openecomp.sdc.be.tosca.CsarUtils; +import org.openecomp.sdc.be.tosca.ToscaError; +import org.openecomp.sdc.be.tosca.ToscaExportHandler; +import org.openecomp.sdc.be.tosca.ToscaRepresentation; +import org.openecomp.sdc.common.api.ArtifactTypeEnum; +import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.util.GeneralUtility; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import fj.data.Either; + +@org.springframework.stereotype.Component("artifactUuidFix") +public class ArtifactUuidFix { + + @Autowired + private TitanDao titanDao; + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + @Autowired + private ToscaExportHandler toscaExportUtils; + @Autowired + private ArtifactCassandraDao artifactCassandraDao; + + @Autowired + private CsarUtils csarUtils; + + private static Logger log = LoggerFactory.getLogger(ArtifactUuidFix.class.getName()); + + public boolean doFix(String fixComponent, String runMode) { + List vfLst = new ArrayList<>(); + List serviceList = new ArrayList<>(); + Map> nodeToFixTosca = new HashMap<>(); + Map> vfToFixTosca = new HashMap<>(); + Map> serviceToFixTosca = new HashMap<>(); + + long time = System.currentTimeMillis(); + + doFixTosca(nodeToFixTosca, vfToFixTosca, serviceToFixTosca); + + if (fixComponent.equals("vf_only")) { + if (fetchFaultVf(fixComponent, vfLst, time) == false) { + return false; + } + } else { + if (fetchServices(fixComponent, serviceList, time) == false) { + return false; + } + } + if (runMode.equals("service_vf") || runMode.equals("fix")) { + log.info("Mode {}. Find problem VFs", runMode); + if (fetchVf(serviceList, vfLst, time) == false) { + log.info("Mode {}. Find problem VFs finished with failure", runMode); + return false; + } + log.info("Mode {}. Find problem VFs finished with success", runMode); + } + if (runMode.equals("fix") || runMode.equals("fix_only_services")) { + log.info("Mode {}. Start fix", runMode); + if (fix(vfLst, serviceList, nodeToFixTosca, vfToFixTosca, serviceToFixTosca) == false) { + log.info("Mode {}. Fix finished with failure", runMode); + return false; + } + log.info("Mode {}. Fix finished with success", runMode); + } + + return true; + } + + private boolean fetchFaultVf(String fixComponent, List vfLst, long time) { + log.info("Find fault VF "); + Writer writer = null; + try { + String fileName = "fault_" + time + ".csv"; + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "utf-8")); + writer.write("vf name, vf id, state, version\n"); + + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VF.name()); + + Map hasNotProps = new HashMap<>(); + hasNotProps.put(GraphPropertyEnum.IS_DELETED, true); + log.info("Try to fetch resources with properties {} and not {}", hasProps, hasNotProps); + + Either, TitanOperationStatus> servicesByCriteria = titanDao + .getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps, hasNotProps, JsonParseFlagEnum.ParseAll); + if (servicesByCriteria.isRight()) { + log.info("Failed to fetch resources {}", servicesByCriteria.right().value()); + return false; + } + List resources = servicesByCriteria.left().value(); + for (GraphVertex gv : resources) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreArtifacts(false); + filter.setIgnoreGroups(false); + + Either toscaElement = toscaOperationFacade + .getToscaElement(gv.getUniqueId()); + if (toscaElement.isRight()) { + log.info("Failed to fetch resources {} {}", gv.getUniqueId(), toscaElement.right().value()); + return false; + } + + Resource resource = toscaElement.left().value(); + String resourceName = resource.getName(); + Map deploymentArtifacts = resource.getDeploymentArtifacts(); + List groups = resource.getGroups(); + if (groups == null || groups.isEmpty()) { + log.info("No groups for resource {} id {} ", resourceName, gv.getUniqueId()); + continue; + } + boolean isProblematic = false; + for (GroupDefinition gr : groups) { + if (gr.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) { + if (isProblematicGroup(gr, resourceName, deploymentArtifacts)) { + isProblematic = true; + break; + } + } + } + if (isProblematic) { + vfLst.add(resource); + writeModuleResultToFile(writer, resource, null); + writer.flush(); + } + titanDao.commit(); + } + + } catch (Exception e) { + log.info("Failed to fetch vf resources ", e); + return false; + } finally { + titanDao.commit(); + try { + writer.flush(); + writer.close(); + } catch (Exception ex) { + /* ignore */ + } + } + return true; + } + + private boolean fetchVf(List serviceList, List vfLst, long time) { + log.info("Find problem VF "); + if (serviceList.isEmpty()) { + log.info("No services as input"); + return true; + } + Writer writer = null; + try { + String fileName = "problemVf_" + time + ".csv"; + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "utf-8")); + writer.write("vf name, vf id, state, version, example service name\n"); + Set vfIds = new HashSet<>(); + for (Service service : serviceList) { + List componentInstances = service.getComponentInstances().stream() + .filter(ci -> ci.getOriginType().equals(OriginTypeEnum.VF)).collect(Collectors.toList()); + for (ComponentInstance ci : componentInstances) { + if (!vfIds.contains(ci.getComponentUid())) { + vfIds.add(ci.getComponentUid()); + Either toscaElement = toscaOperationFacade + .getToscaElement(ci.getComponentUid()); + if (toscaElement.isRight()) { + log.info("Failed to fetch resource {} {}", ci.getComponentUid(), + toscaElement.right().value()); + return false; + } + Resource resource = toscaElement.left().value(); + if (resource.getResourceType().equals(ResourceTypeEnum.VF)) { + vfLst.add(resource); + writeModuleResultToFile(writer, resource, service); + writer.flush(); + titanDao.commit(); + } + } + } + } + log.info("output file with list of Vf : {}", fileName); + } catch (Exception e) { + log.info("Failed to fetch services ", e); + return false; + } finally { + titanDao.commit(); + try { + writer.flush(); + writer.close(); + } catch (Exception ex) { + /* ignore */ + } + } + return true; + } + + private boolean fetchServices(String fixServices, List serviceList, long time) { + log.info("Find problem Services {}", fixServices); + Writer writer = null; + + try { + String fileName = "problemService_" + time + ".csv"; + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "utf-8")); + writer.write("service name, service id, state, version\n"); + + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + if (fixServices.equals("distributed_only")) { + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + hasProps.put(GraphPropertyEnum.DISTRIBUTION_STATUS, DistributionStatusEnum.DISTRIBUTED.name()); + } + + Map hasNotProps = new HashMap<>(); + hasNotProps.put(GraphPropertyEnum.IS_DELETED, true); + log.info("Try to fetch services with properties {} and not {}", hasProps, hasNotProps); + + Either, TitanOperationStatus> servicesByCriteria = titanDao + .getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps, hasNotProps, JsonParseFlagEnum.ParseAll); + if (servicesByCriteria.isRight()) { + log.info("Failed to fetch services {}", servicesByCriteria.right().value()); + return false; + } + List services = servicesByCriteria.left().value(); + for (GraphVertex gv : services) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreArtifacts(false); + filter.setIgnoreGroups(false); + + Either toscaElement = toscaOperationFacade + .getToscaElement(gv.getUniqueId()); + if (toscaElement.isRight()) { + log.info("Failed to fetch service {} {}", gv.getUniqueId(), toscaElement.right().value()); + continue; + } + Service service = toscaElement.left().value(); + List componentInstances = service.getComponentInstances(); + boolean isProblematic = false; + if (componentInstances == null) { + log.info("No instances for service {} ", gv.getUniqueId()); + continue; + } + String serviceName = (String) gv.getMetadataProperty(GraphPropertyEnum.NAME); + + for (ComponentInstance ci : componentInstances) { + Map deploymentArtifacts = ci.getDeploymentArtifacts(); + List groupInstances = ci.getGroupInstances(); + if (groupInstances == null || groupInstances.isEmpty()) { + log.info("No instance groups for instance {} in service {} id {} ", ci.getName(), serviceName, + gv.getUniqueId()); + continue; + } + + for (GroupInstance gi : groupInstances) { + if (gi.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) { + if (isProblematicGroupInstance(gi, ci.getName(), serviceName, deploymentArtifacts)) { + isProblematic = true; + break; + } + } + } + if (isProblematic) { + serviceList.add(service); + writeModuleResultToFile(writer, service, null); + writer.flush(); + break; + } + } + titanDao.commit(); + } + log.info("output file with list of services : {}", fileName); + } catch (Exception e) { + log.info("Failed to fetch services ", e); + return false; + } finally { + titanDao.commit(); + try { + writer.flush(); + writer.close(); + } catch (Exception ex) { + /* ignore */ + } + } + return true; + } + + private boolean isProblematicGroup(GroupDefinition gr, String resourceName, + Map deploymentArtifacts) { + List artifacts = gr.getArtifacts(); + List artifactsUuid = gr.getArtifactsUuid(); + Set artifactsSet = new HashSet<>(); + + if ((artifactsUuid == null || artifactsUuid.isEmpty()) && (artifacts == null || artifacts.isEmpty())) { + log.info("No groups in resource {} ", resourceName); + return true; + } + artifactsSet.addAll(artifacts); + if (artifactsSet.size() < artifacts.size()) { + log.info(" artifactsSet.size() < artifacts.size() group {} in resource {} ", gr.getName(), resourceName); + return true; + } + + if (artifacts.size() < artifactsUuid.size()) { + log.info(" artifacts.size() < artifactsUuid.size() group {} in resource {} ", gr.getName(), resourceName); + return true; + } + if (artifacts.size() > 0 && (artifactsUuid == null || artifactsUuid.isEmpty())) { + log.info( + " artifacts.size() > 0 && (artifactsUuid == null || artifactsUuid.isEmpty() group {} in resource {} ", + gr.getName(), resourceName); + return true; + } + if (artifactsUuid.contains(null)) { + log.info(" artifactsUuid.contains(null) group {} in resource {} ", gr.getName(), resourceName); + return true; + } + + for (String artifactId : artifacts) { + String artifactlabel = findArtifactLabelFromArtifactId(artifactId); + ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactlabel); + if (artifactDefinition == null) { + log.info(" artifactDefinition == null label {} group {} in resource {} ", artifactlabel, gr.getName(), + resourceName); + return true; + } + ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifactDefinition.getArtifactType()); + if (artifactType != ArtifactTypeEnum.HEAT_ENV) { + if (!artifactId.equals(artifactDefinition.getUniqueId())) { + log.info( + " !artifactId.equals(artifactDefinition.getUniqueId() artifact {} artId {} group {} in resource {} ", + artifactlabel, artifactId, gr.getName(), resourceName); + return true; + } + if (!artifactsUuid.contains(artifactDefinition.getArtifactUUID())) { + log.info( + " artifactsUuid.contains(artifactDefinition.getArtifactUUID() label {} group {} in resource {} ", + artifactlabel, gr.getName(), resourceName); + return true; + } + } + } + for (String artifactUUID : artifactsUuid) { + String label = findArtifactLabelFromArtifactId(artifactUUID); + if (label != null && !label.isEmpty() && !label.equals("")) { + return true; + } + } + + return false; + } + + private boolean isProblematicGroupInstance(GroupInstance gi, String instName, String servicename, + Map deploymentArtifacts) { + List artifacts = gi.getArtifacts(); + List artifactsUuid = gi.getArtifactsUuid(); + List instArtifactsUuid = gi.getGroupInstanceArtifactsUuid(); + List instArtifactsId = gi.getGroupInstanceArtifacts(); + Set instArtifatIdSet = new HashSet<>(); + Set artifactsSet = new HashSet<>(); + + if ((artifactsUuid == null || artifactsUuid.isEmpty()) && (artifacts == null || artifacts.isEmpty())) { + log.info("No instance groups for instance {} in service {} ", instName, servicename); + return true; + } + artifactsSet.addAll(artifacts); + if (artifactsSet.size() < artifacts.size()) { + log.info(" artifactsSet.size() < artifacts.size() group {} in resource {} ", instName, servicename); + return true; + } + + if (instArtifactsId != null && !instArtifactsId.isEmpty()) { + instArtifatIdSet.addAll(instArtifactsId); + } + + if (artifacts.size() < artifactsUuid.size()) { + log.info(" artifacts.size() < artifactsUuid.size() inst {} in service {} ", instName, servicename); + return true; + } + if (!artifacts.isEmpty() && (artifactsUuid == null || artifactsUuid.isEmpty())) { + log.info( + " artifacts.size() > 0 && (artifactsUuid == null || artifactsUuid.isEmpty() inst {} in service {} ", + instName, servicename); + return true; + } + if (artifactsUuid.contains(null)) { + log.info(" artifactsUuid.contains(null) inst {} in service {} ", instName, servicename); + return true; + } + if (instArtifactsId != null && instArtifatIdSet.size() < instArtifactsId.size()) { + log.info(" instArtifatIdSet.size() < instArtifactsId.size() inst {} in service {} ", instName, servicename); + return true; + } + + if ((instArtifactsId != null && instArtifactsUuid != null) + && instArtifactsId.size() != instArtifactsUuid.size()) { + log.info(" instArtifactsId.size() != instArtifactsUuid.size() inst {} in service {} ", instName, + servicename); + return true; + } + + for (String artifactId : artifacts) { + String artifactlabel = findArtifactLabelFromArtifactId(artifactId); + ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactlabel); + if (artifactDefinition == null) { + log.info(" artifactDefinition == null label {} inst {} in service {} ", artifactlabel, instName, + servicename); + return true; + } + ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifactDefinition.getArtifactType()); + if (artifactType != ArtifactTypeEnum.HEAT_ENV) { + if (!artifactId.equals(artifactDefinition.getUniqueId())) { + log.info( + " !artifactId.equals(artifactDefinition.getUniqueId() artifact {} artId {} inst {} in service {} ", + artifactlabel, artifactId, instName, servicename); + return true; + } + if (!artifactsUuid.contains(artifactDefinition.getArtifactUUID())) { + log.info( + " artifactsUuid.contains(artifactDefinition.getArtifactUUID() label {} inst {} in service {} ", + artifactlabel, instName, servicename); + return true; + } + } else { + if (instArtifactsUuid == null || instArtifactsUuid.isEmpty()) { + log.info(" instArtifactsUuid empty. label {} inst {} in service {} ", artifactlabel, instName, + servicename); + return true; + } + if (!instArtifactsUuid.contains(artifactDefinition.getArtifactUUID())) { + log.info( + " instArtifactsUuid.contains(artifactDefinition.getArtifactUUID() label {} inst {} in service {} ", + artifactlabel, instName, servicename); + return true; + } + } + } + for (String artifactUUID : artifactsUuid) { + String label = findArtifactLabelFromArtifactId(artifactUUID); + if (label != null && !label.isEmpty() && !label.equals("")) { + return true; + } + } + return false; + } + + private boolean fix(List vfLst, List serviceList, Map> nodesToFixTosca, + Map> vfToFixTosca, Map> servicesToFixTosca) { + boolean res = true; + log.info(" Fix started ***** "); + if (vfLst != null && !vfLst.isEmpty()) { + res = fixVf(vfLst); + + } + + if (res && serviceList != null && !serviceList.isEmpty()) { + res = fixServices(serviceList); + + } + + Set fixedIds = new HashSet<>(); + if (res && nodesToFixTosca != null && !nodesToFixTosca.isEmpty()) { + + generateAndSaveToscaArtifacts(nodesToFixTosca, fixedIds, null); + + for (Map.Entry> entry : nodesToFixTosca.entrySet()) { + List components = entry.getValue(); + for (Component c : components) { + + ToscaElement topologyTemplate = ModelConverter.convertToToscaElement(c); + Map arifacts = topologyTemplate.getToscaArtifacts(); + res = fixDataOnGraph(c.getUniqueId(), VertexTypeEnum.TOSCA_ARTIFACTS, EdgeLabelEnum.TOSCA_ARTIFACTS, + arifacts); + titanDao.commit(); + } + } + + } + if (res && vfToFixTosca != null && !vfToFixTosca.isEmpty()) { + + generateAndSaveToscaArtifacts(vfToFixTosca, fixedIds, vfLst); + + for (Map.Entry> entry : vfToFixTosca.entrySet()) { + List components = entry.getValue(); + for (Component c : components) { + TopologyTemplate topologyTemplate = ModelConverter.convertToToscaElement(c); + Map arifacts = topologyTemplate.getToscaArtifacts(); + res = fixDataOnGraph(c.getUniqueId(), VertexTypeEnum.TOSCA_ARTIFACTS, EdgeLabelEnum.TOSCA_ARTIFACTS, + arifacts); + titanDao.commit(); + } + } + + } + + if (res && servicesToFixTosca != null && !servicesToFixTosca.isEmpty()) { + generateAndSaveToscaArtifacts(servicesToFixTosca, fixedIds, serviceList); + + for (Map.Entry> entry : servicesToFixTosca.entrySet()) { + List components = entry.getValue(); + for (Component c : components) { + TopologyTemplate topologyTemplate = ModelConverter.convertToToscaElement(c); + Map arifacts = topologyTemplate.getToscaArtifacts(); + res = fixDataOnGraph(c.getUniqueId(), VertexTypeEnum.TOSCA_ARTIFACTS, EdgeLabelEnum.TOSCA_ARTIFACTS, + arifacts); + titanDao.commit(); + } + } + + } + + if (res) { + + for (Component component : vfLst) { + generateToscaPerComponent(fixedIds, component); + + TopologyTemplate topologyTemplate = ModelConverter.convertToToscaElement(component); + Map groups = topologyTemplate.getGroups(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.GROUPS, EdgeLabelEnum.GROUPS, groups); + if (res) { + Map arifacts = topologyTemplate.getDeploymentArtifacts(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.DEPLOYMENT_ARTIFACTS, + EdgeLabelEnum.DEPLOYMENT_ARTIFACTS, arifacts); + } + if (res) { + Map arifacts = topologyTemplate.getToscaArtifacts(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.TOSCA_ARTIFACTS, + EdgeLabelEnum.TOSCA_ARTIFACTS, arifacts); + } + titanDao.commit(); + } + } + + if (res) { + + for (Component component : serviceList) { + generateToscaPerComponent(fixedIds, component); + + TopologyTemplate topologyTemplate = ModelConverter.convertToToscaElement(component); + Map groups = topologyTemplate.getInstGroups(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.INST_GROUPS, EdgeLabelEnum.INST_GROUPS, + groups); + + if (res) { + Map artifacts = topologyTemplate.getInstDeploymentArtifacts(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.INST_DEPLOYMENT_ARTIFACTS, + EdgeLabelEnum.INST_DEPLOYMENT_ARTIFACTS, artifacts); + } + if (res) { + Map arifacts = topologyTemplate.getToscaArtifacts(); + res = fixDataOnGraph(component.getUniqueId(), VertexTypeEnum.TOSCA_ARTIFACTS, + EdgeLabelEnum.TOSCA_ARTIFACTS, arifacts); + } + titanDao.commit(); + } + + } + log.info(" Fix finished with res {} ***** ", res); + return res; + } + + private boolean generateAndSaveToscaArtifacts(Map> nodesToFixTosca, Set fixedIds, + List componentsWithFailedGroups) { + boolean res = true; + log.debug("Migration1707ArtifactUuidFix generateAndSaveToscaArtifacts started "); + for (Map.Entry> entry : nodesToFixTosca.entrySet()) { + + List component = entry.getValue(); + for (Component c : component) { + log.debug("Migration1707ArtifactUuidFix fix tosca on component : id {}, name {} ", c.getUniqueId(), + c.getName()); + if (componentsWithFailedGroups != null) { + Optional op = (Optional) componentsWithFailedGroups.stream() + .filter(cg -> cg.getUniqueId().equals(c.getUniqueId())).findAny(); + if (!op.isPresent()) + res = generateToscaPerComponent(fixedIds, c); + } else + res = generateToscaPerComponent(fixedIds, c); + } + } + log.debug("Migration1707ArtifactUuidFix generateAndSaveToscaArtifacts finished with res {} ", res); + return res; + } + + private boolean generateToscaPerComponent(Set fixedIds, Component c) { + boolean res = true; + log.debug("Migration1707ArtifactUuidFix generateToscaPerComponent started component name {} id {}", + c.getName(), c.getUniqueId()); + try { + Either toscaElement = toscaOperationFacade + .getToscaFullElement(c.getUniqueId()); + if (toscaElement.isRight()) { + log.info("Failed to fetch resources {} {}", c.getUniqueId(), toscaElement.right().value()); + return false; + } + Component toscaElementFull = toscaElement.left().value(); + toscaElementFull.setGroups(c.getGroups()); + List ciListFull = toscaElementFull.getComponentInstances(); + List ciList = c.getComponentInstances(); + if (ciListFull != null && !ciListFull.isEmpty()) { + ciListFull.forEach(ciFull -> { + ComponentInstance compInst = ciList.stream() + .filter(ci -> ci.getUniqueId().equals(ciFull.getUniqueId())).findAny().get(); + ciFull.setGroupInstances(compInst.getGroupInstances()); + }); + } + + Map toscaArtifacts = c.getToscaArtifacts(); + log.debug("Migration1707ArtifactUuidFix generateToscaPerComponent tocsa artifacts size {}", + toscaArtifacts.size()); + + Either either = Either.right(ToscaError.GENERAL_ERROR); + ArtifactDefinition toscaArtifact = null; + Optional op = toscaArtifacts.values().stream() + .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType())).findAny(); + + if (op.isPresent()) { + toscaArtifact = op.get(); + } + + if (toscaArtifact != null) { + log.debug("Migration1707ArtifactUuidFix generateToscaPerComponent artifact name {} id {} esId {}", + toscaArtifact.getArtifactName(), toscaArtifact.getUniqueId(), toscaArtifact.getEsId()); + either = generateToscaArtifact(toscaElementFull, toscaArtifact); + if (either.isRight()) { + log.error("Couldn't generate and save tosca template component unique id {}, name {} error: {}", + toscaElementFull.getUniqueId(), toscaElementFull.getName(), either.right().value()); + res = false; + + } + } + if (res) { + + ArtifactDefinition csarArtifact = null; + op = toscaArtifacts.values().stream() + .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.TOSCA_CSAR.getType())).findAny(); + + if (op.isPresent()) { + csarArtifact = op.get(); + } + + if (csarArtifact != null) { + log.debug("Migration1707ArtifactUuidFix generateToscaPerComponent artifact name {} id {} esId {}", + csarArtifact.getArtifactName(), csarArtifact.getUniqueId(), csarArtifact.getEsId()); + either = generateToscaArtifact(toscaElementFull, csarArtifact); + if (either.isRight()) { + log.error("Couldn't generate and save tosca csar for component uuid {}, id {}, name {}. error: {}", + toscaElementFull.getUUID(), toscaElementFull.getUniqueId(), toscaElementFull.getName(), either.right().value()); + res = false; + + } + } + } + c.setToscaArtifacts(toscaArtifacts); + + if (res) { + fixedIds.add(toscaElementFull.getUniqueId()); + } + } finally { + titanDao.commit(); + } + log.debug("Migration1707ArtifactUuidFix generateToscaPerComponent finished component name {} id {} res {}", + c.getName(), c.getUniqueId(), res); + return res; + } + + private boolean fixDataOnGraph(String componentId, VertexTypeEnum vertexTypeEnum, + EdgeLabelEnum edgeLabelEnum, Map groups) { + log.debug("amount groups to update: VertexTypeEnum {} EdgeLabelEnum {} data size {}", vertexTypeEnum.getName(), + edgeLabelEnum, groups.size()); + boolean res = true; + Either getResponse = titanDao.getVertexById(componentId, + JsonParseFlagEnum.NoParse); + if (getResponse.isRight()) { + log.debug("Couldn't fetch component unique id {}, error: {}", componentId, getResponse.right().value()); + res = false; + + } + if (res) { + GraphVertex componentVertex = getResponse.left().value(); + + GraphVertex toscaDataVertex = null; + Either groupVertexEither = titanDao.getChildVertex(componentVertex, + edgeLabelEnum, JsonParseFlagEnum.ParseJson); + if (groupVertexEither.isRight() && groupVertexEither.right().value() == TitanOperationStatus.NOT_FOUND) { + log.debug("no child {} vertex for component unique id {}, error: {}", edgeLabelEnum, componentId, + groupVertexEither.right().value()); + return true; + } + if (groupVertexEither.isRight()) { + res = false; + log.debug("failed to get child {} vertex for component unique id {}, error: {}", edgeLabelEnum, + componentId, groupVertexEither.right().value()); + } + if (res) { + toscaDataVertex = groupVertexEither.left().value(); + toscaDataVertex.setJson(groups); + Either updatevertexEither = titanDao.updateVertex(toscaDataVertex); + if (updatevertexEither.isRight()) { + log.debug("failed to update vertex for component unique id {}, error: {}", componentId, + updatevertexEither.right().value()); + titanDao.rollback(); + return false; + } + } + } + log.debug("Fix data on graph finished: VertexTypeEnum {} EdgeLabelEnum {} res {}", vertexTypeEnum.getName(), + res); + return res; + } + + private boolean fixServices(List serviceList) { + for (Service service : serviceList) { + log.debug("Migration1707ArtifactUuidFix fix service: id {}, name {} ", service.getUniqueId(), + service.getName()); + List instances = service.getComponentInstances(); + for (ComponentInstance instance : instances) { + fixComponentInstances(service, instance); + } + + } + return true; + + } + + private void fixComponentInstances(Service service, ComponentInstance instance) { + Map artifactsMap = instance.getDeploymentArtifacts(); + List groupsList = instance.getGroupInstances(); + if (groupsList != null && artifactsMap != null) { + List groupsToDelete = new ArrayList<>(); + for (GroupInstance group : groupsList) { + fixGroupInstances(service, artifactsMap, groupsToDelete, group); + + } + + if (!groupsToDelete.isEmpty()) { + log.debug("Migration1707ArtifactUuidFix delete group: resource id {}, group instance to delete {} ", + service.getUniqueId(), groupsToDelete); + groupsList.removeAll(groupsToDelete); + + } + + Optional optionalVfModuleArtifact = artifactsMap.values().stream() + .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA.name())).findAny(); + if (optionalVfModuleArtifact.isPresent()) { + ArtifactDefinition vfModuleAertifact = optionalVfModuleArtifact.get(); + fillVfModuleInstHeatEnvPayload(groupsList, vfModuleAertifact); + } + } + } + + private void fixGroupInstances(Service service, Map artifactsMap, + List groupsToDelete, GroupInstance group) { + if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) { + log.debug("Migration1707ArtifactUuidFix fix group: resource id {}, group name {} ", service.getUniqueId(), + group.getName()); + List groupArtifacts = new ArrayList(group.getArtifacts()); + + group.getArtifacts().clear(); + group.getArtifactsUuid().clear(); + group.getGroupInstanceArtifacts().clear(); + group.getGroupInstanceArtifactsUuid().clear(); + + for (String artifactId : groupArtifacts) { + fixArtifactUndergroupInstances(artifactsMap, group, groupArtifacts, artifactId); + } + if (group.getArtifacts() == null || group.getArtifacts().isEmpty()) { + log.debug( + "Migration1707ArtifactUuidFix fix groupInstance add to delete list: resource id {} name {} , group name {} ", + service.getUniqueId(), service.getName(), group.getName()); + groupsToDelete.add(group); + } + } + } + + private void fixArtifactUndergroupInstances(Map artifactsMap, GroupInstance group, + List groupArtifacts, String artifactId) { + String artifactlabel = findArtifactLabelFromArtifactId(artifactId); + log.debug("Migration1707ArtifactUuidFix fix group: group name {} artifactId for fix {} artifactlabel {} ", + group.getName(), artifactId, artifactlabel); + if (!artifactlabel.isEmpty() && artifactsMap.containsKey(artifactlabel)) { + ArtifactDefinition artifact = artifactsMap.get(artifactlabel); + ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifact.getArtifactType()); + String correctArtifactId = artifact.getUniqueId(); + String correctArtifactUUID = artifact.getArtifactUUID(); + if (artifactType != ArtifactTypeEnum.HEAT_ENV) { + boolean isAddToGroup = true; + if (groupArtifacts.size() == 1) { + + if (artifactType == ArtifactTypeEnum.HEAT_ARTIFACT) { + isAddToGroup = false; + artifact.setArtifactType(ArtifactTypeEnum.OTHER.getType()); + } + } + if (isAddToGroup) { + log.debug( + "Migration1707ArtifactUuidFix fix group: group name {} correct artifactId {} artifactUUID {} ", + group.getName(), correctArtifactId, correctArtifactUUID); + group.getArtifacts().add(correctArtifactId); + if (correctArtifactUUID != null && !correctArtifactUUID.isEmpty()) { + group.getArtifactsUuid().add(correctArtifactUUID); + } + } + } else { + log.debug( + "Migration1707ArtifactUuidFix fix group: group name {} correct artifactId {} artifactUUID {} ", + group.getName(), correctArtifactId, correctArtifactUUID); + group.getGroupInstanceArtifacts().add(correctArtifactId); + if (correctArtifactUUID != null && !correctArtifactUUID.isEmpty()) { + group.getGroupInstanceArtifactsUuid().add(correctArtifactUUID); + } + } + } + } + + private boolean fixVf(List vfLst) { + for (Resource resource : vfLst) { + log.debug("Migration1707ArtifactUuidFix fix resource: id {}, name {} ", resource.getUniqueId(), + resource.getName()); + Map artifactsMap = resource.getDeploymentArtifacts(); + List groupsList = resource.getGroups(); + List groupsToDelete = new ArrayList<>(); + if (groupsList != null && artifactsMap != null) { + for (GroupDefinition group : groupsList) { + if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE) && group.getArtifacts() != null) { + fixVfGroup(resource, artifactsMap, group); + } + if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE) + && (group.getArtifacts() == null || group.getArtifacts().isEmpty())) { + log.debug( + "Migration1707ArtifactUuidFix add group to delete list fix resource: id {}, name {} ", + resource.getUniqueId(), resource.getName(), group.getName()); + groupsToDelete.add(group); + } + } + + if (!groupsToDelete.isEmpty()) { + groupsList.removeAll(groupsToDelete); + + } + } + + } + + return true; + } + + private void fixVfGroup(Resource resource, Map artifactsMap, GroupDefinition group) { + log.debug("Migration1707ArtifactUuidFix fix group: resource id {}, group name {} ", resource.getUniqueId(), + group.getName()); + List groupArtifacts = new ArrayList<>(group.getArtifacts()); + + for (String artifactId : groupArtifacts) { + fixArtifactUnderGroup(artifactsMap, group, groupArtifacts, artifactId); + } + } + + private void fixArtifactUnderGroup(Map artifactsMap, GroupDefinition group, + List groupArtifacts, String artifactId) { + group.getArtifacts().clear(); + group.getArtifactsUuid().clear(); + String artifactlabel = findArtifactLabelFromArtifactId(artifactId); + log.debug("Migration1707ArtifactUuidFix fix group: group name {} artifactId for fix {} artifactlabel {} ", + group.getName(), artifactId, artifactlabel); + if (!artifactlabel.isEmpty() && artifactsMap.containsKey(artifactlabel)) { + ArtifactDefinition artifact = artifactsMap.get(artifactlabel); + String correctArtifactId = artifact.getUniqueId(); + String correctArtifactUUID = artifact.getArtifactUUID(); + boolean isAddToGroup = true; + if (groupArtifacts.size() == 1) { + ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifact.getArtifactType()); + if (artifactType == ArtifactTypeEnum.HEAT_ARTIFACT) { + isAddToGroup = false; + artifact.setArtifactType(ArtifactTypeEnum.OTHER.getType()); + } + } + if (isAddToGroup) { + log.debug( + "Migration1707ArtifactUuidFix fix group: group name {} correct artifactId {} artifactUUID {} ", + group.getName(), correctArtifactId, correctArtifactUUID); + group.getArtifacts().add(correctArtifactId); + if (correctArtifactUUID != null && !correctArtifactUUID.isEmpty()) { + group.getArtifactsUuid().add(correctArtifactUUID); + } + } + + } + } + + private String findArtifactLabelFromArtifactId(String artifactId) { + String artifactLabel = ""; + + int index = artifactId.lastIndexOf('.'); + if (index > 0 && index + 1 < artifactId.length()) + artifactLabel = artifactId.substring(index + 1); + return artifactLabel; + } + + private void writeModuleResultToFile(Writer writer, org.openecomp.sdc.be.model.Component component, + Service service) { + try { + // "service name, service id, state, version + StringBuilder sb = new StringBuilder(component.getName()); + sb.append(",").append(component.getUniqueId()).append(",").append(component.getLifecycleState()).append(",") + .append(component.getVersion()); + if (service != null) { + sb.append(",").append(service.getName()); + } + sb.append("\n"); + writer.write(sb.toString()); + } catch (IOException e) { + log.error(e.getMessage()); + } + } + + private void writeModuleResultToFile(Writer writer, List components) { + try { + // "service name, service id, state, version + for (Component component : components) { + StringBuilder sb = new StringBuilder(component.getName()); + sb.append(",").append(component.getUniqueId()).append(",").append(component.getInvariantUUID()) + .append(",").append(component.getLifecycleState()).append(",").append(component.getVersion()); + + sb.append("\n"); + writer.write(sb.toString()); + } + } catch (IOException e) { + + log.error(e.getMessage()); + } + } + + public boolean doFixTosca(Map> nodeToFix, Map> vfToFix, + Map> serviceToFix) { + + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + Map> vertices = getVerticesToValidate(VertexTypeEnum.NODE_TYPE, hasProps); + boolean result = validateTosca(vertices, nodeToFix, "RESOURCE_TOSCA_ARTIFACTS");// + + hasProps.clear(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VF); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + vertices = getVerticesToValidate(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps); + result = validateTosca(vertices, vfToFix, "VF_TOSCA_ARTIFACTS"); + + hasProps.clear(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + vertices = getVerticesToValidate(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps); + result = validateTosca(vertices, serviceToFix, "SERVICE_TOSCA_ARTIFACTS"); + + return result; + } + + public Map> getVerticesToValidate(VertexTypeEnum type, + Map hasProps) { + + Map> result = new HashMap<>(); + try { + + Either, TitanOperationStatus> resultsEither = titanDao.getByCriteria(type, hasProps); + if (resultsEither.isRight()) { + System.out.println("getVerticesToValidate failed " + resultsEither.right().value()); + return result; + } + System.out.println("getVerticesToValidate: " + resultsEither.left().value().size() + " vertices to scan"); + List componentsList = resultsEither.left().value(); + componentsList.forEach(vertex -> { + String ivariantUuid = (String) vertex.getMetadataProperty(GraphPropertyEnum.INVARIANT_UUID); + if (!result.containsKey(ivariantUuid)) { + List compList = new ArrayList(); + result.put(ivariantUuid, compList); + } + List compList = result.get(ivariantUuid); + + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreArtifacts(false); + + Either toscaElement = toscaOperationFacade + .getToscaElement(vertex.getUniqueId(), filter); + if (toscaElement.isRight()) { + System.out.println("getVerticesToValidate: failed to find element" + vertex.getUniqueId() + + " staus is" + toscaElement.right().value()); + } else { + compList.add(toscaElement.left().value()); + } + titanDao.commit(); + + }); + + } catch (Exception e) { + log.info("Failed to fetch vf resources ", e); + + } finally { + titanDao.commit(); + + } + return result; + } + + public boolean validateTosca(Map> vertices, Map> compToFix, + String name) { + boolean result = true; + long time = System.currentTimeMillis(); + String fileName = name + "_" + time + ".csv"; + Writer writer = null; + try { + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "utf-8")); + writer.write("name, UUID, invariantUUID, state, version\n"); + for (Map.Entry> entry : vertices.entrySet()) { + List compList = entry.getValue(); + Set artifactEsId = new HashSet<>(); + for (Component component : compList) { + Map toscaArtifacts = component.getToscaArtifacts(); + Optional op = toscaArtifacts.values().stream() + .filter(a -> artifactEsId.contains(a.getEsId()) && a.getEsId() != null).findAny(); + if (op.isPresent()) { + result = false; + writeModuleResultToFile(writer, compList); + writer.flush(); + break; + } else { + artifactEsId.addAll(toscaArtifacts.values().stream().map(ArtifactDefinition::getEsId) + .collect(Collectors.toList())); + } + } + if (!result) { + List compListfull = new ArrayList<>(); + for (Component c : compList) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreArtifacts(false); + filter.setIgnoreGroups(false); + + Either toscaElement = toscaOperationFacade + .getToscaElement(c.getUniqueId(), filter); + if (toscaElement.isRight()) { + System.out.println("getVerticesToValidate: failed to find element" + c.getUniqueId() + + " staus is" + toscaElement.right().value()); + } else { + compListfull.add(toscaElement.left().value()); + } + this.titanDao.commit(); + } + + compToFix.put(entry.getKey(), compListfull); + result = true; + } + + } + + } catch (Exception e) { + log.info("Failed to fetch vf resources ", e); + return false; + } finally { + titanDao.commit(); + try { + writer.flush(); + writer.close(); + } catch (Exception ex) { + /* ignore */} + } + return result; + } + + private Either generateToscaArtifact(Component parent, + ArtifactDefinition artifactInfo) { + log.debug("tosca artifact generation"); + try { + if (artifactInfo.getArtifactType().equals(ArtifactTypeEnum.TOSCA_CSAR.getType())) { + Either generated = csarUtils.createCsar(parent, true, true); + + if (generated.isRight()) { + log.debug("Failed to export tosca csar for component {} error {}", parent.getUniqueId(), + generated.right().value()); + + return Either.right(ToscaError.GENERAL_ERROR); + } + byte[] value = generated.left().value(); + artifactInfo.setPayload(value); + + } else { + Either exportComponent = toscaExportUtils.exportComponent(parent); + if (exportComponent.isRight()) { + log.debug("Failed export tosca yaml for component {} error {}", parent.getUniqueId(), + exportComponent.right().value()); + + return Either.right(exportComponent.right().value()); + } + log.debug("Tosca yaml exported for component {} ", parent.getUniqueId()); + String payload = exportComponent.left().value().getMainYaml(); + + artifactInfo.setPayloadData(payload); + } + + byte[] decodedPayload = artifactInfo.getPayloadData(); + artifactInfo.setEsId(artifactInfo.getUniqueId()); + artifactInfo.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(decodedPayload)); + ESArtifactData artifactData = new ESArtifactData(artifactInfo.getEsId(), decodedPayload); + artifactCassandraDao.saveArtifact(artifactData); + log.debug("Tosca yaml artifact esId ", artifactInfo.getEsId()); + } catch (Exception ex) { + log.error("Failed to generate tosca atifact id {} component id {} component name {} error {}",artifactInfo.getUniqueId(), + parent.getUniqueId(), parent.getName(), ex.getMessage() ); + + return Either.right(ToscaError.GENERAL_ERROR); + } + + return Either.left(artifactInfo); + } + + private void fillVfModuleInstHeatEnvPayload(List groupsForCurrVF, + ArtifactDefinition vfModuleArtifact) { + + List vfModulePayloadForCurrVF = new ArrayList(); + if (groupsForCurrVF != null) { + for (GroupInstance groupInstance : groupsForCurrVF) { + VfModuleArtifactPayload modulePayload = new VfModuleArtifactPayload(groupInstance); + vfModulePayloadForCurrVF.add(modulePayload); + } + Collections.sort(vfModulePayloadForCurrVF, + (art1, art2) -> VfModuleArtifactPayload.compareByGroupName(art1, art2)); + + final Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + String vfModulePayloadString = gson.toJson(vfModulePayloadForCurrVF); + if (vfModulePayloadString != null) { + String newCheckSum = GeneralUtility + .calculateMD5Base64EncodedByByteArray(vfModulePayloadString.getBytes()); + vfModuleArtifact.setArtifactChecksum(newCheckSum); + + ESArtifactData artifactData = new ESArtifactData(vfModuleArtifact.getEsId(), + vfModulePayloadString.getBytes()); + artifactCassandraDao.saveArtifact(artifactData); + + } + + } + + } +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java new file mode 100644 index 0000000000..556d7e0eee --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.asdctool.impl.validator; + +import java.util.List; + +import org.openecomp.sdc.asdctool.impl.validator.executers.IArtifactValidatorExecuter; +import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class ArtifactToolBL { + + private static Logger log = LoggerFactory.getLogger(ValidationToolBL.class.getName()); + + @Autowired + protected List validators; + + @Autowired + protected ReportManager reportManager; + + private boolean allValid = true; + + + public boolean validateAll() { + for (IArtifactValidatorExecuter validatorExec: validators) { + System.out.println("ValidatorExecuter "+validatorExec.getName()+" started"); + if (!validatorExec.executeValidations()) { + allValid = false; + System.out.println("ValidatorExecuter "+validatorExec.getName()+" finished with warnings"); + } + else { + System.out.println("ValidatorExecuter "+validatorExec.getName()+" finished successfully"); + } + } + return allValid; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManager.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManager.java index 79b36f0004..90d850686b 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManager.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManager.java @@ -11,16 +11,22 @@ import java.util.Properties; public class ValidationConfigManager { private static Properties prop = new Properties(); + private static String outputFullFilePath; + private static String outputFilePath; + public static String getOutputFullFilePath() { + return outputFullFilePath; + } public static String getOutputFilePath() { return outputFilePath; } - public static void setOutputFilePath(String outputPath) { - ValidationConfigManager.outputFilePath = outputPath+ "/reportOutput.txt"; + public static void setOutputFullFilePath(String outputPath) { + ValidationConfigManager.outputFilePath = outputPath; + ValidationConfigManager.outputFullFilePath = outputPath+ "/reportOutput.txt"; } - private static String outputFilePath; + public static String getCsvReportFilePath() { return csvReportFilePath; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java index 3b81ba81e4..63e95d568b 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java @@ -1,7 +1,11 @@ package org.openecomp.sdc.asdctool.impl.validator.config; +import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL; import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; +import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter; +import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceToscaArtifactsValidatorExecutor; import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; +import org.openecomp.sdc.asdctool.impl.validator.executers.VFToscaArtifactValidatorExecutor; import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter; import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ArtifactValidationUtils; import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ServiceArtifactValidationTask; @@ -37,6 +41,15 @@ public class ValidationToolConfiguration { @Bean public ServiceValidatorExecuter basicServiceValidator() { return new ServiceValidatorExecuter();} + + @Bean + public NodeToscaArtifactsValidatorExecuter NodeToscaArtifactsValidatorValidator() { return new NodeToscaArtifactsValidatorExecuter();} + + @Bean + public ServiceToscaArtifactsValidatorExecutor ServiceToscaArtifactsValidator() { return new ServiceToscaArtifactsValidatorExecutor();} + + @Bean + public VFToscaArtifactValidatorExecutor VFToscaArtifactValidator() { return new VFToscaArtifactValidatorExecutor();} @Bean public VfArtifactValidationTask vfArtifactValidationTask() { return new VfArtifactValidationTask(); } @@ -51,6 +64,11 @@ public class ValidationToolConfiguration { public ValidationToolBL validationToolBL() { return new ValidationToolBL(); } + + @Bean + public ArtifactToolBL artifactToolBL() { + return new ArtifactToolBL(); + } @Bean public VfValidatorExecuter basicVfValidator() { return new VfValidatorExecuter();} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java new file mode 100644 index 0000000000..4b9764d2d5 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java @@ -0,0 +1,145 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import java.io.BufferedWriter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +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.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import org.openecomp.sdc.asdctool.impl.validator.config.ValidationConfigManager; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; + +public class ArtifactValidatorExecuter{ + + @Autowired + protected TitanDao titanDao; + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + private static Logger log = LoggerFactory.getLogger(ArtifactValidatorExecuter.class.getName()); + + protected String name; + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + + + public Map> getVerticesToValidate(VertexTypeEnum type, Map hasProps){ + Map> result = new HashMap<>(); + Either, TitanOperationStatus> resultsEither = titanDao.getByCriteria(type, hasProps); + if (resultsEither.isRight()) { + System.out.println("getVerticesToValidate failed "+ resultsEither.right().value()); + return result; + } + System.out.println("getVerticesToValidate: "+resultsEither.left().value().size()+" vertices to scan"); + List componentsList = resultsEither.left().value(); + componentsList.forEach(vertex -> { + String ivariantUuid = (String)vertex.getMetadataProperty(GraphPropertyEnum.INVARIANT_UUID); + if(!result.containsKey(ivariantUuid)){ + List compList = new ArrayList(); + result.put(ivariantUuid, compList); + } + List compList = result.get(ivariantUuid); + + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreArtifacts(false); + + Either toscaElement = toscaOperationFacade.getToscaElement(vertex.getUniqueId(), filter); + if (toscaElement.isRight()) { + System.out.println("getVerticesToValidate: failed to find element"+ vertex.getUniqueId()+" staus is" + toscaElement.right().value()); + }else{ + compList.add(toscaElement.left().value()); + } + + }); + + return result; + } + + public boolean validate( Map> vertices) { + boolean result = true; + long time = System.currentTimeMillis(); + String fileName = ValidationConfigManager.getOutputFilePath() + this.getName() + "_"+ time + ".csv"; + Writer writer = null; + try { + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "utf-8")); + writer.write("name, UUID, invariantUUID, state, version\n"); + Collection> collection = vertices.values(); + for(List compList: collection ){ + Set artifactEsId = new HashSet<>(); + for(Component component: compList ){ + Map toscaArtifacts = component.getToscaArtifacts(); + Optional op = toscaArtifacts.values(). + stream().filter(a -> artifactEsId.contains(a.getEsId())).findAny(); + if(op.isPresent()){ + result = false; + writeModuleResultToFile(writer, compList); + writer.flush(); + break; + }else{ + artifactEsId.addAll(toscaArtifacts.values().stream().map(ArtifactDefinition::getEsId).collect(Collectors.toList())) ; + } + } + + } + + } catch (Exception e) { + log.info("Failed to fetch vf resources ", e); + return false; + } finally { + titanDao.commit(); + try { + writer.flush(); + writer.close(); + } catch (Exception ex) { + /* ignore */} + } + return result; + } + + private void writeModuleResultToFile(Writer writer, List components) { + try { + // "service name, service id, state, version + for(Component component: components ){ + StringBuffer sb = new StringBuffer(component.getName()); + sb.append(",").append(component.getUniqueId()).append(",").append(component.getInvariantUUID()).append(",").append(component.getLifecycleState()).append(",").append(component.getVersion()); + + sb.append("\n"); + writer.write(sb.toString()); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java new file mode 100644 index 0000000000..6f9405f992 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java @@ -0,0 +1,9 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +public interface IArtifactValidatorExecuter { + boolean executeValidations(); + String getName(); + + + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java new file mode 100644 index 0000000000..6715c8a955 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java @@ -0,0 +1,41 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.LifecycleStateEnum; + +public class NodeToscaArtifactsValidatorExecuter extends ArtifactValidatorExecuter implements IArtifactValidatorExecuter{ + protected String name; + + public NodeToscaArtifactsValidatorExecuter() { + setName("RESOURCE_TOSCA_ARTIFACTS"); + } + @Override + public boolean executeValidations() { + + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + Map> vertices = getVerticesToValidate(VertexTypeEnum.NODE_TYPE, hasProps); + return validate(vertices); + + } + + @Override + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java new file mode 100644 index 0000000000..2fe5abef3c --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java @@ -0,0 +1,39 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.LifecycleStateEnum; + +public class ServiceToscaArtifactsValidatorExecutor extends ArtifactValidatorExecuter implements IArtifactValidatorExecuter{ + + + public ServiceToscaArtifactsValidatorExecutor() { + setName("SERVICE_TOSCA_ARTIFACTS"); + } + @Override + public boolean executeValidations() { + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + Map> vertices = getVerticesToValidate(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps); + return validate(vertices); + } + + @Override + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java new file mode 100644 index 0000000000..bc22f2e424 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.LifecycleStateEnum; + +public class VFToscaArtifactValidatorExecutor extends ArtifactValidatorExecuter implements IArtifactValidatorExecuter{ + + public VFToscaArtifactValidatorExecutor() { + setName("VF_TOSCA_ARTIFACTS"); + } + @Override + public boolean executeValidations() { + + Map hasProps = new HashMap<>(); + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VF); + hasProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + Map> vertices = getVerticesToValidate(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps); + return validate( vertices); + + } + + @Override + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java index 4a4af15fdf..a19a98ed27 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java @@ -34,7 +34,7 @@ public class ReportManager { } private void initReportFile() throws IOException { - reportOutputFilePath = ValidationConfigManager.getOutputFilePath(); + reportOutputFilePath = ValidationConfigManager.getOutputFullFilePath(); StrBuilder sb = new StrBuilder(); sb.appendln("-----------------------Validation Tool Results:-------------------------"); Files.write(Paths.get(reportOutputFilePath), sb.toString().getBytes()); diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactUUIDFixMenu.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactUUIDFixMenu.java new file mode 100644 index 0000000000..5ca8e55412 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactUUIDFixMenu.java @@ -0,0 +1,45 @@ +package org.openecomp.sdc.asdctool.main; + +import org.openecomp.sdc.asdctool.configuration.ArtifactUUIDFixConfiguration; +import org.openecomp.sdc.asdctool.configuration.ConfigurationUploader; +import org.openecomp.sdc.asdctool.impl.ArtifactUuidFix; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +public class ArtifactUUIDFixMenu { + + private static Logger log = LoggerFactory.getLogger(ArtifactUUIDFixMenu.class); + + public static void main(String[] args) { + if (args == null || args.length < 3) { + System.out.println("Usage: "); + System.exit(1); + } + String fixServices = args[1]; + String runMode = args[2]; + // String fixTosca = args[3]; + log.info("Start fixing artifact UUID after 1707 migration with arguments run with configuration [{}] , for [{}] services", runMode, fixServices); + String appConfigDir = args[0]; + ConfigurationUploader.uploadConfigurationFiles(appConfigDir); + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ArtifactUUIDFixConfiguration.class); + ArtifactUuidFix artifactUuidFix = context.getBean(ArtifactUuidFix.class); + boolean isSuccessful = artifactUuidFix.doFix(fixServices, runMode); + if (isSuccessful) { + log.info("Fixing artifacts UUID for 1707 was finished successfully"); + /* isSuccessful = artifactUuidFix.doFixTosca(fixTosca, fixServices, runMode); + if (isSuccessful) { + log.info("Fixing tosca artifacts was finished successfully"); + isSuccessful = artifactUuidFix.doFixTosca(fixTosca, fixServices, runMode); + } else{ + log.info("Fixing tosca artifacts has failed"); + System.exit(2); + }*/ + } else{ + log.info("Fixing artifacts UUID for 1707 has failed"); + System.exit(2); + } + System.exit(0); + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java new file mode 100644 index 0000000000..f7e8f1fa8b --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.asdctool.main; + +import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL; +import org.openecomp.sdc.asdctool.impl.validator.config.ValidationConfigManager; +import org.openecomp.sdc.asdctool.impl.validator.config.ValidationToolConfiguration; +import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.impl.FSConfigurationSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +public class ArtifactValidatorTool { + private static Logger log = LoggerFactory.getLogger(ValidationTool.class.getName()); + + public static void main(String[] args) throws Exception { + + String outputPath = args[0]; + ValidationConfigManager.setOutputFullFilePath(outputPath); + ValidationConfigManager.setCsvReportFilePath(outputPath); + + String appConfigDir = args[1]; + AnnotationConfigApplicationContext context = initContext(appConfigDir); + ArtifactToolBL validationToolBL = context.getBean(ArtifactToolBL.class); + + System.out.println("Start ArtifactValidation Tool"); + Boolean result = validationToolBL.validateAll(); + // ReportManager.reportEndOfToolRun(); + if (result) { + System.out.println("ArtifactValidation finished successfully"); + System.exit(0); + } else { + System.out.println("ArtifactValidation finished with warnings"); + System.exit(2); + } + } + + private static AnnotationConfigApplicationContext initContext(String appConfigDir) { + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ValidationToolConfiguration.class); + return context; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/UpdateIsVnfMenu.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/UpdateIsVnfMenu.java index 73b7306de4..dce9f9c072 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/UpdateIsVnfMenu.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/UpdateIsVnfMenu.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.asdctool.impl.UpdatePropertyOnVertex; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ValidationTool.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ValidationTool.java index 1ee006a49f..51e2d500da 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ValidationTool.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ValidationTool.java @@ -22,7 +22,7 @@ public class ValidationTool { public static void main(String[] args) throws Exception { String outputPath = args[0]; - ValidationConfigManager.setOutputFilePath(outputPath); + ValidationConfigManager.setOutputFullFilePath(outputPath); ValidationConfigManager.setCsvReportFilePath(outputPath); String appConfigDir = args[1]; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java index 4d52347788..19651ec45a 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java @@ -1,21 +1,70 @@ package org.openecomp.sdc.asdctool.migration.config; +import java.util.ArrayList; +import java.util.List; + import org.openecomp.sdc.asdctool.migration.core.SdcMigrationTool; import org.openecomp.sdc.asdctool.migration.core.task.Migration; +import org.openecomp.sdc.asdctool.migration.core.task.PostMigration; +import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao; import org.openecomp.sdc.asdctool.migration.resolver.MigrationResolver; import org.openecomp.sdc.asdctool.migration.resolver.SpringBeansMigrationResolver; import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; +import org.openecomp.sdc.be.auditing.impl.AuditingManager; +import org.openecomp.sdc.be.components.ArtifactsResolver; +import org.openecomp.sdc.be.components.distribution.engine.DistributionEngine; +import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder; +import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic; +import org.openecomp.sdc.be.components.impl.ArtifactResolverImpl; +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; +import org.openecomp.sdc.be.components.impl.CompositionBusinessLogic; +import org.openecomp.sdc.be.components.impl.GroupBusinessLogic; +import org.openecomp.sdc.be.components.impl.InputsBusinessLogic; +import org.openecomp.sdc.be.components.impl.ProductBusinessLogic; +import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; +import org.openecomp.sdc.be.components.impl.ResourceImportManager; +import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; +import org.openecomp.sdc.be.components.impl.ServiceComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.VFComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; +import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; +import org.openecomp.sdc.be.components.merge.heat.HeatEnvArtifactsMergeBusinessLogic; +import org.openecomp.sdc.be.components.merge.input.InputsValuesMergingBusinessLogic; +import org.openecomp.sdc.be.components.merge.instance.ComponentInstanceMergeDataBusinessLogic; +import org.openecomp.sdc.be.components.merge.property.DataDefinitionsValuesMergingBusinessLogic; +import org.openecomp.sdc.be.dao.DAOTitanStrategy; +import org.openecomp.sdc.be.dao.TitanClientStrategy; +import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao; import org.openecomp.sdc.be.dao.cassandra.CassandraClient; -import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao; import org.openecomp.sdc.be.dao.config.DAOSpringConfig; +import org.openecomp.sdc.be.dao.es.ElasticSearchClient; +import org.openecomp.sdc.be.dao.impl.AuditingDao; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.titan.TitanGenericDao; +import org.openecomp.sdc.be.dao.titan.TitanGraphClient; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.cache.ComponentCache; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation; +import org.openecomp.sdc.be.model.operations.impl.ComponentInstanceOperation; +import org.openecomp.sdc.be.model.operations.impl.CsarOperation; +import org.openecomp.sdc.be.model.operations.impl.ElementOperation; +import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupInstanceOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupOperation; +import org.openecomp.sdc.be.model.operations.impl.GroupTypeOperation; +import org.openecomp.sdc.be.model.operations.impl.PropertyOperation; +import org.openecomp.sdc.be.tosca.CsarUtils; +import org.openecomp.sdc.be.tosca.ToscaExportHandler; +import org.openecomp.sdc.be.user.UserBusinessLogic; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; - -import java.util.ArrayList; -import java.util.List; +import org.springframework.core.io.FileSystemResource; @Configuration @Import(DAOSpringConfig.class) @@ -23,13 +72,19 @@ import java.util.List; "org.openecomp.sdc.be.model.operations.impl", "org.openecomp.sdc.be.model.cache", "org.openecomp.sdc.be.dao.titan", + "org.openecomp.sdc.be.components.validation", "org.openecomp.sdc.be.dao.cassandra", "org.openecomp.sdc.be.model.jsontitan.operations", - "org.openecomp.sdc.be.dao.jsongraph"}) + "org.openecomp.sdc.be.dao.jsongraph", + "org.openecomp.sdc.be.components.merge", + "org.openecomp.sdc.be.impl"}) public class MigrationSpringConfig { @Autowired(required=false) private List migrations = new ArrayList<>(); + + @Autowired(required=false) + private List postMigrations = new ArrayList<>(); @Bean(name = "sdc-migration-tool") public SdcMigrationTool sdcMigrationTool(MigrationResolver migrationResolver, SdcRepoService sdcRepoService) { @@ -38,7 +93,7 @@ public class MigrationSpringConfig { @Bean(name = "spring-migrations-resolver") public SpringBeansMigrationResolver migrationResolver(SdcRepoService sdcRepoService) { - return new SpringBeansMigrationResolver(migrations, sdcRepoService); + return new SpringBeansMigrationResolver(migrations, postMigrations, sdcRepoService); } @Bean(name = "sdc-repo-service") @@ -57,5 +112,247 @@ public class MigrationSpringConfig { } + @Bean(name = "dao-titan-strategy") + public TitanClientStrategy daoStrategy() { + return new DAOTitanStrategy(); + } + + @Bean(name = "titan-dao") + public TitanDao titanDao(@Qualifier("titan-client") TitanGraphClient titanGraphClient) { + return new TitanDao(titanGraphClient); + } + + @Bean(name = "titan-client", initMethod = "createGraph") + public TitanGraphClient titanClient(@Qualifier("dao-titan-strategy") TitanClientStrategy titanClientStrategy) { + return new TitanGraphClient(titanClientStrategy); + } + + @Bean(name = "resource-business-logic") + public ResourceBusinessLogic resourceBusinessLogic() { + return new ResourceBusinessLogic(); + } + +// @Bean(name = "healthCheckBusinessLogic") +// public HealthCheckBusinessLogic healthCheckBusinessLogic() { +// return new HealthCheckBusinessLogic(); +// } +// +// @Bean(name = "distribution-engine-cluster-health") +// public DistributionEngineClusterHealth distributionEngineClusterHealth() { +// return new DistributionEngineClusterHealth(); +// } +// +// @Bean(name = "cassandra-health-check") +// public CassandraHealthCheck cassandraHealthCheck() { +// return new CassandraHealthCheck(); +// } + +// @Bean(name = "switchover-detector") +// public SwitchoverDetector switchoverDetector() { +// return new SwitchoverDetector(); +// } + + @Bean(name = "service-business-logic") + public ServiceBusinessLogic serviceBusinessLogic() { + return new ServiceBusinessLogic(); + } + + @Bean(name = "capability-type-operation") + public CapabilityTypeOperation CapabilityTypeOperation() { + return new CapabilityTypeOperation(); + } + + @Bean(name = "lifecycle-business-logic") + public LifecycleBusinessLogic lifecycleBusinessLogic() { + return new LifecycleBusinessLogic(); + } + + @Bean(name = "property-operation") + public PropertyOperation propertyOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao) { + return new PropertyOperation(titanGenericDao); + } + + @Bean(name = "csar-operation") + public CsarOperation csarOperation() { + return new CsarOperation(); + } + + @Bean(name = "vf-component-instance-business-logic") + public VFComponentInstanceBusinessLogic vFComponentInstanceBusinessLogic() { + return new VFComponentInstanceBusinessLogic(); + } + + @Bean(name = "resource-import-manager") + public ResourceImportManager resourceImportManager() { + return new ResourceImportManager(); + } + + @Bean(name = "group-business-logic") + public GroupBusinessLogic groupBusinessLogic() { + return new GroupBusinessLogic(); + } + + @Bean(name = "inputs-business-logic") + public InputsBusinessLogic inputsBusinessLogic() { + return new InputsBusinessLogic(); + } + + @Bean(name = "composition-business-logic") + public CompositionBusinessLogic compositionBusinessLogic() { + return new CompositionBusinessLogic(); + } + + @Bean(name = "artifacts-business-logic") + public ArtifactsBusinessLogic artifactsBusinessLogic() { + return new ArtifactsBusinessLogic(); + } + + @Bean(name = "component-cache") + public ComponentCache componentCache() { + return new ComponentCache(); + } + + @Bean(name = "componentUtils") + public ComponentsUtils componentsUtils() { + return new ComponentsUtils(); + } + + @Bean(name = "user-business-logic") + public UserBusinessLogic userBusinessLogic() { + return new UserBusinessLogic(); + } + + @Bean(name = "graph-lock-operation") + public GraphLockOperation graphLockOperation() { + return new GraphLockOperation(); + } + + @Bean(name = "titan-generic-dao") + public TitanGenericDao titanGenericDao(@Qualifier("titan-client") TitanGraphClient titanGraphClient) { + return new TitanGenericDao(titanGraphClient); + } + + @Bean(name = "element-operation") + public ElementOperation elementOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao) { + return new ElementOperation(titanGenericDao); + } + + @Bean(name = "group-operation") + public GroupOperation groupOperation() { + return new GroupOperation(); + } + + @Bean(name = "group-instance-operation") + public GroupInstanceOperation groupInstanceOperation() { + return new GroupInstanceOperation(); + } + + @Bean(name = "group-type-operation") + public GroupTypeOperation groupTypeOperation(@Qualifier("titan-generic-dao") TitanGenericDao titanGenericDao, @Qualifier("property-operation") PropertyOperation propertyOperation) { + return new GroupTypeOperation(titanGenericDao, propertyOperation); + } + + @Bean(name = "tosca-operation-facade") + public ToscaOperationFacade toscaOperationFacade() { + return new ToscaOperationFacade(); + } + + @Bean(name = "distribution-engine") + public DistributionEngine distributionEngine() { + return null; + } + + @Bean(name = "audit-cassandra-dao") + public AuditCassandraDao auditCassandraDao() { + return new AuditCassandraDao(); + } + + @Bean(name = "service-component-instance-business-logic") + public ServiceComponentInstanceBusinessLogic serviceComponentInstanceBusinessLogic() { + return new ServiceComponentInstanceBusinessLogic(); + } + + @Bean("tosca-export-handler") + public ToscaExportHandler toscaExportHandler() { + return new ToscaExportHandler(); + } + + @Bean(name = "component-instance-operation") + public ComponentInstanceOperation componentInstanceOperation() { + return new ComponentInstanceOperation(); + } + + @Bean(name = "additional-information-business-logic") + public AdditionalInformationBusinessLogic additionalInformationBusinessLogic() { + return new AdditionalInformationBusinessLogic(); + } + + @Bean(name = "auditing-manager") + public AuditingManager auditingManager() { + return new AuditingManager(); + } + + @Bean(name = "auditing-dao") + public AuditingDao auditingDao() { + return new AuditingDao(); + } + + @Bean(name = "elasticsearch-client", initMethod = "initialize") + public ElasticSearchClient elasticSearchClient() { + return new ElasticSearchClient(); + } + + @Bean(name = "csar-utils") + public CsarUtils csarUtils() { + return new CsarUtils(); + } + + @Bean(name = "service-distribution-artifacts-builder") + public ServiceDistributionArtifactsBuilder serviceDistributionArtifactsBuilder() { + return new ServiceDistributionArtifactsBuilder(); + } + + @Bean(name = "product-business-logic") + public ProductBusinessLogic productBusinessLogic() { + return null; + } + + @Bean(name = "dataDefinitionsValuesMergingBusinessLogic") + public DataDefinitionsValuesMergingBusinessLogic dataDefinitionsValuesMergingBusinessLogic() { + return new DataDefinitionsValuesMergingBusinessLogic(); + } + + @Bean(name = "artifacts-resolver") + public ArtifactsResolver artifactsResolver() { + return new ArtifactResolverImpl(); + } + + @Bean(name = "InputsValuesMergingBusinessLogic") + public InputsValuesMergingBusinessLogic InputsValuesMergingBusinessLogic(){ + return new InputsValuesMergingBusinessLogic(); + } + + @Bean(name = "GenericTypeBusinessLogic") + public GenericTypeBusinessLogic genericTypeBusinessLogic(){ + return new GenericTypeBusinessLogic(); + } + + @Bean(name ="componentInstanceMergeDataBusinessLogic") + public ComponentInstanceMergeDataBusinessLogic componentInstanceMergeDataBusinessLogic(){ + return new ComponentInstanceMergeDataBusinessLogic(); + } + + @Bean(name ="heatEnvArtifactsMergeBusinessLogic") + public HeatEnvArtifactsMergeBusinessLogic heatEnvArtifactsMergeBusinessLogic(){ + return new HeatEnvArtifactsMergeBusinessLogic(); + } + + @Bean(name = "elasticsearchConfig") + public PropertiesFactoryBean mapper() { + String configHome = System.getProperty("config.home"); + PropertiesFactoryBean bean = new PropertiesFactoryBean(); + bean.setLocation(new FileSystemResource(configHome + "/elasticsearch.yml")); + return bean; + } } diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java index 21671a67a9..b8e2347970 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java @@ -4,7 +4,8 @@ import java.util.List; import org.openecomp.sdc.asdctool.migration.core.execution.MigrationExecutionResult; import org.openecomp.sdc.asdctool.migration.core.execution.MigrationExecutorImpl; -import org.openecomp.sdc.asdctool.migration.core.task.Migration; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage.AspectMigrationEnum; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.openecomp.sdc.asdctool.migration.resolver.MigrationResolver; import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; @@ -30,16 +31,17 @@ public class SdcMigrationTool { public boolean migrate(boolean enforceAll) { LOGGER.info("starting migration process"); handleEnforceMigrationFlag(enforceAll); - List migrations = migrationsResolver.resolveMigrations(); + List migrations = migrationsResolver.resolveMigrations(); LOGGER.info("there are {} migrations task to execute", migrations.size()); - for (Migration migration : migrations) { + for (IMigrationStage migration : migrations) { try { MigrationExecutionResult executionResult = new MigrationExecutorImpl().execute(migration); if (migrationHasFailed(executionResult)) { LOGGER.error("migration {} with version {} has failed. error msg: {}", migration.getClass().getName(), migration.getVersion().toString(), executionResult.getMsg()); return false; } - sdcRepoService.createMigrationTask(executionResult.toMigrationTaskEntry()); + if(migration.getAspectMigration() == AspectMigrationEnum.MIGRATION) + sdcRepoService.createMigrationTask(executionResult.toMigrationTaskEntry()); } catch (RuntimeException e) { LOGGER.error("migration {} with version {} has failed. error msg: {}", migration.getClass().getName(), migration.getVersion().toString(), e); return false; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResult.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResult.java index accd9eca53..aa871914d6 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResult.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResult.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.asdctool.migration.core.execution; +import java.util.Date; + import org.openecomp.sdc.asdctool.migration.core.DBVersion; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.openecomp.sdc.be.resources.data.MigrationTaskEntry; -import java.util.Date; - public class MigrationExecutionResult { private MigrationResult.MigrationStatus migrationStatus; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutor.java index aba5056b48..cf3e50a312 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutor.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutor.java @@ -1,7 +1,7 @@ package org.openecomp.sdc.asdctool.migration.core.execution; import org.openecomp.sdc.asdctool.migration.core.MigrationException; -import org.openecomp.sdc.asdctool.migration.core.task.Migration; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; public interface MigrationExecutor { @@ -10,6 +10,6 @@ public interface MigrationExecutor { * @return a {@link MigrationExecutionResult} with the relevant data on the current migration execution; * @throws MigrationException in case there was an unexpected exception during migration */ - MigrationExecutionResult execute(Migration migration) throws MigrationException; + MigrationExecutionResult execute(IMigrationStage migration) throws MigrationException; } diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImpl.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImpl.java index 39219aee23..2b3b28a737 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImpl.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImpl.java @@ -1,7 +1,7 @@ package org.openecomp.sdc.asdctool.migration.core.execution; import org.openecomp.sdc.asdctool.migration.core.MigrationException; -import org.openecomp.sdc.asdctool.migration.core.task.Migration; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,7 +13,7 @@ public class MigrationExecutorImpl implements MigrationExecutor { private static final Logger LOGGER = LoggerFactory.getLogger(MigrationExecutorImpl.class); @Override - public MigrationExecutionResult execute(Migration migration) throws MigrationException { + public MigrationExecutionResult execute(IMigrationStage migration) throws MigrationException { try { LOGGER.info("starting migration {}. description: {}. version {}", migration.getClass().getName(), migration.description(), migration.getVersion().toString()); StopWatch stopWatch = new StopWatch(); @@ -29,12 +29,12 @@ public class MigrationExecutorImpl implements MigrationExecutor { } } - private MigrationExecutionResult logAndCreateExecutionResult(Migration migration, MigrationResult migrationResult, double executionTime) { + private MigrationExecutionResult logAndCreateExecutionResult(IMigrationStage migration, MigrationResult migrationResult, double executionTime) { LOGGER.info("finished migration {}. with version {}. migration status: {}, migration message: {}, execution time: {}", migration.getClass().getName(), migration.getVersion().toString(), migrationResult.getMigrationStatus().name(), migrationResult.getMsg(), executionTime); return createMigrationTask(migration, migrationResult, executionTime); } - private MigrationExecutionResult createMigrationTask(Migration migration, MigrationResult migrationResult, double totalTimeSeconds) { + private MigrationExecutionResult createMigrationTask(IMigrationStage migration, MigrationResult migrationResult, double totalTimeSeconds) { MigrationExecutionResult migrationExecutionResult = new MigrationExecutionResult(); migrationExecutionResult.setExecutionTime(totalTimeSeconds); migrationExecutionResult.setMigrationStatus(migrationResult.getMigrationStatus()); diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/IMigrationStage.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/IMigrationStage.java new file mode 100644 index 0000000000..d58da7d784 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/IMigrationStage.java @@ -0,0 +1,20 @@ +package org.openecomp.sdc.asdctool.migration.core.task; + +import org.openecomp.sdc.asdctool.migration.core.DBVersion; + +public interface IMigrationStage { + + String description(); + + DBVersion getVersion(); + + MigrationResult migrate(); + + AspectMigrationEnum getAspectMigration(); + + public enum AspectMigrationEnum { + BEFORE_MIGRATION, + MIGRATION, + AFTER_MIGRATION; + } +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/Migration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/Migration.java index 58f201acf5..6ec95dce8b 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/Migration.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/Migration.java @@ -1,14 +1,10 @@ package org.openecomp.sdc.asdctool.migration.core.task; - -import org.openecomp.sdc.asdctool.migration.core.DBVersion; - -public interface Migration { - - String description(); - - DBVersion getVersion(); - - MigrationResult migrate(); +public interface Migration extends IMigrationStage{ + @Override + default + AspectMigrationEnum getAspectMigration(){ + return AspectMigrationEnum.MIGRATION; + } } diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/PostMigration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/PostMigration.java new file mode 100644 index 0000000000..f20c36471d --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/task/PostMigration.java @@ -0,0 +1,19 @@ +package org.openecomp.sdc.asdctool.migration.core.task; + +import org.openecomp.sdc.asdctool.migration.core.DBVersion; + +public interface PostMigration extends IMigrationStage { + + @Override + default + public DBVersion getVersion() { + return DBVersion.CURRENT_VERSION; + } + + @Override + default + AspectMigrationEnum getAspectMigration(){ + return AspectMigrationEnum.AFTER_MIGRATION; + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java index 03fd8d1e7d..b0bfabb059 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java @@ -1,11 +1,9 @@ package org.openecomp.sdc.asdctool.migration.dao; -import com.datastax.driver.core.ResultSet; -import com.datastax.driver.core.Row; -import com.datastax.driver.core.Session; -import com.datastax.driver.mapping.Mapper; -import com.datastax.driver.mapping.MappingManager; -import fj.data.Either; +import java.math.BigInteger; + +import javax.annotation.PostConstruct; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.CassandraDao; import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus; @@ -13,10 +11,14 @@ import org.openecomp.sdc.be.resources.data.MigrationTaskEntry; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; -import java.math.BigInteger; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.MappingManager; + +import fj.data.Either; public class MigrationTasksDao extends CassandraDao { diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/main/MigrationMenu.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/main/MigrationMenu.java index 1e8a533624..dc2114dcd7 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/main/MigrationMenu.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/main/MigrationMenu.java @@ -7,12 +7,9 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; +import org.openecomp.sdc.asdctool.configuration.ConfigurationUploader; import org.openecomp.sdc.asdctool.migration.config.MigrationSpringConfig; import org.openecomp.sdc.asdctool.migration.core.SdcMigrationTool; -import org.openecomp.sdc.be.config.ConfigurationManager; -import org.openecomp.sdc.common.api.ConfigurationSource; -import org.openecomp.sdc.common.impl.ExternalConfiguration; -import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -25,7 +22,7 @@ public class MigrationMenu { CommandLine commandLine = initCmdLineOptions(args); String appConfigDir = commandLine.getOptionValue("c"); boolean enforceAll = commandLine.hasOption("e"); - uploadConfiguration(appConfigDir); + ConfigurationUploader.uploadConfigurationFiles(appConfigDir); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MigrationSpringConfig.class); doMigrate(enforceAll, context); @@ -91,10 +88,4 @@ public class MigrationMenu { .build(); } - private static void uploadConfiguration(String appConfigDir) { - ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); - ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); - } - - } diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java index b272d45ff0..22add31eb4 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java @@ -1,16 +1,16 @@ package org.openecomp.sdc.asdctool.migration.resolver; -import org.openecomp.sdc.asdctool.migration.core.task.Migration; - import java.util.List; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; + public interface MigrationResolver { /** * * @return a list of {@code T} */ - List resolveMigrations(); + List resolveMigrations(); } diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java index 4af5d76123..182996f5e4 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java @@ -1,38 +1,49 @@ package org.openecomp.sdc.asdctool.migration.resolver; -import org.openecomp.sdc.asdctool.migration.core.DBVersion; -import org.openecomp.sdc.asdctool.migration.core.task.Migration; -import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; - import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; +import org.openecomp.sdc.asdctool.migration.core.DBVersion; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; +import org.openecomp.sdc.asdctool.migration.core.task.Migration; +import org.openecomp.sdc.asdctool.migration.core.task.PostMigration; +import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; + public class SpringBeansMigrationResolver implements MigrationResolver { private List migrations = new ArrayList<>(); - + private List postMigrations = new ArrayList<>(); + private SdcRepoService sdcRepoService; - public SpringBeansMigrationResolver(List migrations, SdcRepoService sdcRepoService) { + public SpringBeansMigrationResolver(List migrations, List postMigrations, SdcRepoService sdcRepoService) { this.migrations = migrations; + this.postMigrations = postMigrations; this.sdcRepoService = sdcRepoService; } @Override - public List resolveMigrations() { + public List resolveMigrations() { migrations.sort(Comparator.comparing(Migration::getVersion)); - return resolveNonExecutedMigrations(); + List allTasks = resolveNonExecutedMigrations(); + allTasks.addAll(postMigrations); + return allTasks; } //package private for testing void setMigrations(List migrations) { this.migrations = migrations; } + + //package private for testing + void setPostMigrations(List postMigrations) { + this.postMigrations = postMigrations; + } - private List resolveNonExecutedMigrations() { + private List resolveNonExecutedMigrations() { DBVersion latestDBVersion = sdcRepoService.getLatestDBVersion(); return migrations.stream() .filter(mig -> isMigrationVersionGreaterThanLatestVersion(latestDBVersion, mig)) diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoService.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoService.java index 20451f2c63..cf4affb345 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoService.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoService.java @@ -1,11 +1,11 @@ package org.openecomp.sdc.asdctool.migration.service; +import java.math.BigInteger; + import org.openecomp.sdc.asdctool.migration.core.DBVersion; import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao; import org.openecomp.sdc.be.resources.data.MigrationTaskEntry; -import java.math.BigInteger; - public class SdcRepoService { private MigrationTasksDao migrationTasksDao; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/OutputHandler.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/OutputHandler.java new file mode 100644 index 0000000000..59259219db --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/OutputHandler.java @@ -0,0 +1,9 @@ +package org.openecomp.sdc.asdctool.migration.tasks.handlers; + +public interface OutputHandler { + + public void initiate(Object... title); + public void addRecord(Object... record); + public boolean writeOutput(); + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandler.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandler.java new file mode 100644 index 0000000000..91eaed5429 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandler.java @@ -0,0 +1,66 @@ +package org.openecomp.sdc.asdctool.migration.tasks.handlers; + +import java.io.FileOutputStream; +import java.text.DateFormat; +import java.text.SimpleDateFormat; + +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class XlsOutputHandler implements OutputHandler { + + private final static Logger LOGGER = LoggerFactory.getLogger(XlsOutputHandler.class); + + private Workbook workbook; + private Sheet activeSheet; + private Row currentRow; + int rowCount = 0; + + public XlsOutputHandler(Object... title){ + initiate(title); + } + + @Override + public void initiate(Object... title) { + LOGGER.info("Starting to initiate xls output handler. "); + workbook = new HSSFWorkbook(); + activeSheet = workbook.createSheet("Upgrade Migration 1710.0 results"); + addRecord(title); + LOGGER.info("Xls output handler has been initiated. "); + } + + @Override + public void addRecord(Object... record) { + LOGGER.debug("Going to add record {} to output. ", record); + currentRow = activeSheet.createRow(rowCount++); + LOGGER.debug("A new row has been created"); + int columnCount = 0; + Cell cell; + for(Object cellValue : record){ + cell = currentRow.createCell(columnCount++); + if(cellValue != null) + cell.setCellValue(cellValue.toString()); + } + } + + @Override + public boolean writeOutput() { + try { + DateFormat df = new SimpleDateFormat("yyyyMMdd_HHmmss"); + String fileName = "UpgradeMigration1710Results_" + df.format(System.currentTimeMillis()) + ".xls"; + LOGGER.info("Going to write xls output file {}. ", fileName); + workbook.write(new FileOutputStream(fileName)); + return true; + } catch (Exception e) { + LOGGER.error("Failed to write an output file upon Upgrade migration 1710. Exception {} occured. ", e.getMessage()); + e.printStackTrace(); + return false; + } + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java new file mode 100644 index 0000000000..166512d5b4 --- /dev/null +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java @@ -0,0 +1,739 @@ +package org.openecomp.sdc.asdctool.migration.tasks.mig1710; + +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; +import org.openecomp.sdc.asdctool.migration.core.task.PostMigration; +import org.openecomp.sdc.asdctool.migration.tasks.handlers.XlsOutputHandler; +import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; +import org.openecomp.sdc.be.components.impl.ServiceComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; +import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction; +import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction.LifecycleChanceActionEnum; +import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; +import org.openecomp.sdc.be.model.operations.api.IUserAdminOperation; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.model.operations.impl.CsarOperation; +import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import fj.data.Either; + +@Component +public class UpgradeMigration1710 implements PostMigration { + + private static final String UNKNOWN = "UNKNOWN"; + + private static final String CHECKOUT_MESSAGE = "checkout upon upgrade migration"; + + private static final String FAILED_TO_CHANGE_STATE_OF_COMPONENT = "Failed to change state of component with name {}, invariantUUID {}, version {} to {}. "; + + private static final String FAILED_TO_UPGRADE_COMPONENT = "Failed to upgrade {} with name {}, invariantUUID {}, version {}. Operation {}. The reason for failure: {}. "; + + private static final String UPGRADE_COMPONENT_SUCCEEDED = "Upgrade of {} with name {}, invariantUUID {}, version {} finished successfully. "; + + private static final String UPGRADE_VFS_FAILED = "Upgrade VFs upon upgrade migration 1710 process failed. "; + + private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeMigration1710.class); + + @Autowired + private TitanDao titanDao; + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + + @Autowired + private LifecycleBusinessLogic lifecycleBusinessLogic; + + @Autowired + private IUserAdminOperation userAdminOperation; + + @Autowired + private ResourceBusinessLogic resourceBusinessLogic; + + @Autowired + private CsarOperation csarOperation; + + @Autowired + private ServiceComponentInstanceBusinessLogic componentInstanceBusinessLogic; + + @Autowired + private ComponentsUtils componentsUtils; + + private final XlsOutputHandler outputHandler = new XlsOutputHandler("COMPONENT TYPE", "COMPONENT NAME", "COMPONENT UUID", "COMPONENT UNIQUE_ID", "UPGRADE STATUS", "DESCRIPTION"); + + private User user = null; + + private final LifecycleChangeInfoWithAction changeInfo = new LifecycleChangeInfoWithAction(CHECKOUT_MESSAGE, LifecycleChanceActionEnum.UPGRADE_MIGRATION); + + private final Map latestGenericTypes = new HashMap<>(); + + private boolean isVfcUpgradeRequired = false; + + private boolean skipIfUpgradeVfFailed = true; + + /** below methods is defined on package level for testing + * where Spring object injection is not used **/ + void setUserAdminOperation(IUserAdminOperation userAdminOperation) { this.userAdminOperation = userAdminOperation; } + + void setTitanDao(TitanDao titanDao) { this.titanDao = titanDao; } + + void setTosckaOperationFacade(ToscaOperationFacade toscaOperationFacade) { this.toscaOperationFacade = toscaOperationFacade; } + + void setLifecycleBusinessLogic(LifecycleBusinessLogic lifecycleBusinessLogic) { this.lifecycleBusinessLogic = lifecycleBusinessLogic; } + + void setComponentsUtils(ComponentsUtils componentsUtils) { this.componentsUtils = componentsUtils; } + + + /***********************************************/ + + @Override + public String description() { + return "Upgrade migration 1710 - post migration task, which is dedicated to upgrade all latest certified (and not checked out) Node types, VFs and Services. "; + } + + private enum UpgradeStatus{ + UPGRADED, + NOT_UPGRADED + } + + @Override + public MigrationResult migrate() { + LOGGER.info("Starting upgrade migration 1710 process. "); + MigrationResult migrationResult = new MigrationResult(); + + try{ + boolean result = true; + + isVfcUpgradeRequired = !ConfigurationManager.getConfigurationManager().getConfiguration().getSkipUpgradeVSPsFlag(); + skipIfUpgradeVfFailed = ConfigurationManager.getConfigurationManager().getConfiguration().getSkipUpgradeFailedVfs(); + final String userId = ConfigurationManager.getConfigurationManager().getConfiguration().getAutoHealingOwner(); + + Either userReq = userAdminOperation.getUserData(userId, false); + if (userReq.isRight()) { + result = false; + LOGGER.error("Upgrade migration was failed. User {} resolve failed: {} ", userId, userReq.right().value()); + } + else { + user = userReq.left().value(); + LOGGER.info("User {} will perform upgrade operation", user.toString()); + } + + if(result){ + result = upgradeNodeTypes(); + } + if(result){ + result = upgradeVFs(); + } + if(result){ + upgradeServices(); + } + if(result){ + LOGGER.info("Upgrade migration 1710 has been successfully finished. "); + titanDao.commit(); + migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.COMPLETED); + } else { + LOGGER.info("Upgrade migration 1710 was failed. "); + titanDao.rollback(); + migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.FAILED); + } + } catch(Exception e){ + LOGGER.error("Upgrade migration 1710 was failed. ", e); + titanDao.rollback(); + migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.FAILED); + } finally { + outputHandler.writeOutput(); + } + return migrationResult; + } + + private StorageOperationStatus upgradeServices() { + LOGGER.info("Starting upgrade services upon upgrade migration 1710 process. "); + Map latestOriginResourceVersions = new HashMap<>(); + Either, TitanOperationStatus> getServicesRes = getAllLatestCertifiedComponentUids(VertexTypeEnum.TOPOLOGY_TEMPLATE, ComponentTypeEnum.SERVICE); + if(getServicesRes.isRight()){ + return StorageOperationStatus.GENERAL_ERROR; + } + for(String currUid : getServicesRes.left().value()){ + try{ + if(handleService(currUid, latestOriginResourceVersions)){ + titanDao.commit(); + } else { + processComponentUpgradeFailure(ComponentTypeEnum.SERVICE.name(), currUid, ""); + } + } catch(Exception e){ + processComponentUpgradeFailure(ComponentTypeEnum.SERVICE.name(), currUid, e.getMessage()); + } + } + return StorageOperationStatus.OK; + } + + private void processComponentUpgradeFailure(final String name, final String currUid, final String reason) { + LOGGER.error("Failed to upgrade {} with uniqueId {} due to a reason {}. ", name, currUid, reason); + titanDao.rollback(); + } + + private boolean handleService(String uniqueId, Map latestOriginResourceVersions) { + LOGGER.info("Starting upgrade Service with uniqueId {} upon upgrade migration 1710 process. ", uniqueId); + Either getServiceRes = toscaOperationFacade.getToscaElement(uniqueId); + if(getServiceRes.isRight()){ + LOGGER.error("Failed to upgrade service with uniqueId {} due to {}. ", uniqueId, getServiceRes.right().value()); + outputHandler.addRecord(ComponentTypeEnum.SERVICE.name(), UNKNOWN, UNKNOWN, uniqueId, MigrationResult.MigrationStatus.FAILED.name(), getServiceRes.right().value()); + return false; + } + String derivedFromGenericType = getServiceRes.left().value().getDerivedFromGenericType(); + LOGGER.debug("derivedFromGenericType: {}", derivedFromGenericType ); + if (derivedFromGenericType == null) { + //malformed field value, upgrade required + return upgradeService(getServiceRes.left().value()); + } + if(!latestGenericTypes.containsKey(derivedFromGenericType)){ + Either, TitanOperationStatus> getDerivedRes = findDerivedResources(derivedFromGenericType); + if(getDerivedRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, getServiceRes.left().value().getComponentType().getValue(), getServiceRes.left().value().getName(), getServiceRes.left().value().getInvariantUUID(), getServiceRes.left().value().getVersion(), "findDerivedResources", getDerivedRes.right().value()); + outputHandler.addRecord( getServiceRes.left().value().getComponentType().name(),getServiceRes.left().value().getName(), getServiceRes.left().value().getInvariantUUID(), getServiceRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), getDerivedRes.right().value()); + return false; + } + latestGenericTypes.put(derivedFromGenericType, getDerivedRes.left().value().get(0)); + } + if(latestVersionExists(latestGenericTypes.get(derivedFromGenericType), getServiceRes.left().value().getDerivedFromGenericVersion())){ + return upgradeService(getServiceRes.left().value()); + } + if(!collectLatestOriginResourceVersions(getServiceRes.left().value(), latestOriginResourceVersions)){ + return false; + } + if(shouldUpgrade(getServiceRes.left().value(), latestOriginResourceVersions)){ + return upgradeService(getServiceRes.left().value()); + } + outputHandler.addRecord(getServiceRes.left().value().getComponentType().name(), getServiceRes.left().value().getName(), getServiceRes.left().value().getInvariantUUID(), getServiceRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.COMPLETED.name(), UpgradeStatus.NOT_UPGRADED); + return true; + } + + private boolean collectLatestOriginResourceVersions(org.openecomp.sdc.be.model.Component component, Map latestOriginResourceVersions) { + if(CollectionUtils.isNotEmpty(component.getComponentInstances())){ + for(ComponentInstance instance : component.getComponentInstances()){ + if(instance.getOriginType() != OriginTypeEnum.ServiceProxy && !latestOriginResourceVersions.containsKey(instance.getToscaComponentName())){ + VertexTypeEnum vertexType = ModelConverter.getVertexType(instance.getOriginType().name()); + Either getOriginRes = toscaOperationFacade.getLatestCertifiedByToscaResourceName(instance.getToscaComponentName(), vertexType, JsonParseFlagEnum.ParseMetadata); + if(getOriginRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, component.getComponentType().getValue(), component.getName(), component.getInvariantUUID(), component.getVersion(), "toscaOperationFacade.getLatestCertifiedByToscaResourceName", getOriginRes.right().value()); + outputHandler.addRecord( component.getComponentType().name(), component.getName(), component.getInvariantUUID(), component.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), getOriginRes.right().value()); + return false; + } + latestOriginResourceVersions.put(instance.getToscaComponentName(), getOriginRes.left().value().getVersion()); + } + } + } + return true; + } + + private boolean shouldUpgrade(org.openecomp.sdc.be.model.Component component, Map latestOriginResources) { + boolean shouldUpgrade = false; + if(CollectionUtils.isNotEmpty(component.getComponentInstances())){ + for(ComponentInstance instance : component.getComponentInstances()){ + if(instance.getOriginType() == OriginTypeEnum.ServiceProxy){ + LOGGER.info("The service with name {}, invariantUUID {}, version {}, contains Service proxy instance {}, than the service should be upgraded. ", component.getName(), component.getInvariantUUID(), component.getVersion(), instance.getName()); + shouldUpgrade = true; + } + if(isGreater(latestOriginResources.get(instance.getToscaComponentName()), instance.getComponentVersion())){ + LOGGER.info("The service with name {}, invariantUUID {}, version {}, contains instance {} from outdated version of origin {} {} , than the service should be upgraded. ", component.getName(), component.getInvariantUUID(), component.getVersion(), instance.getName(), instance.getComponentName(), instance.getComponentVersion()); + shouldUpgrade = true; + } + } + } + return shouldUpgrade; + } + + private boolean upgradeService(org.openecomp.sdc.be.model.Component service) { + String serviceName = service.getName(); + String serviceUuid = service.getUUID(); + LOGGER.info("Starting upgrade Service with name {}, invariantUUID {}, version {} upon upgrade migration 1710 process. ", serviceName, service.getInvariantUUID(), service.getVersion()); + LOGGER.info("Starting to perform check out of service {}. ", serviceName); + Either checkouRes = lifecycleBusinessLogic.changeComponentState(service.getComponentType(), service.getUniqueId(), user, LifeCycleTransitionEnum.CHECKOUT, changeInfo, true, false); + if(checkouRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, service.getComponentType().getValue(), serviceName, service.getInvariantUUID(), service.getVersion(), "lifecycleBusinessLogic.changeComponentState", checkouRes.right().value().getFormattedMessage()); + outputHandler.addRecord(service.getComponentType().name(), serviceName, serviceUuid, service.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), checkouRes.right().value().getFormattedMessage()); + return false; + } + Either updateCompositionRes = updateComposition(checkouRes.left().value()); + if(updateCompositionRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, service.getComponentType().getValue(), serviceName, service.getInvariantUUID(), service.getVersion(), "updateComposition", updateCompositionRes.right().value().getFormattedMessage()); + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getUUID(), checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), updateCompositionRes.right().value().getFormattedMessage()); + return false; + } + Either certifyRes = performFullCertification(checkouRes.left().value()); + if(certifyRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, service.getComponentType().getValue(), serviceName, service.getInvariantUUID(), service.getVersion(), "performFullCertification", certifyRes.right().value().getFormattedMessage()); + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getInvariantUUID(), checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), certifyRes.right().value().getFormattedMessage()); + return false; + } + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), serviceUuid, checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.COMPLETED.name(), UpgradeStatus.UPGRADED); + return true; + } + + private Either updateComposition(org.openecomp.sdc.be.model.Component component) { + Either upgradeInstanceRes; + for(ComponentInstance instance : component.getComponentInstances()){ + upgradeInstanceRes = upgradeInstance(component, instance); + if(upgradeInstanceRes.isRight()) { + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, component.getComponentType().getValue(), component.getName(), component.getInvariantUUID(), component.getVersion(), "upgradeInstance", upgradeInstanceRes.right().value().getFormattedMessage()); + outputHandler.addRecord(component.getComponentType().name(), component.getName(), component.getUUID(), component.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), upgradeInstanceRes.right().value().getFormattedMessage()); + return Either.right(upgradeInstanceRes.right().value()); + } + } + return Either.left(component); + } + + private Either upgradeInstance(org.openecomp.sdc.be.model.Component component, ComponentInstance instance) { + LOGGER.info("Starting upgrade {} instance {} upon upgrade migration 1710 process. ", component.getComponentType().getValue(), instance.getName()); + ComponentInstance newComponentInstance = new ComponentInstance(instance); + if(instance.getOriginType() == OriginTypeEnum.ServiceProxy){ + return upgradeServiceProxyInstance(component, instance, newComponentInstance); + } + return upgradeResourceInstance(component, instance, newComponentInstance); + } + + private Either upgradeResourceInstance(org.openecomp.sdc.be.model.Component component, + ComponentInstance instance, ComponentInstance newComponentInstance) { + LOGGER.info("Starting upgrade {} instance {} upon upgrade migration 1710 process. ", component.getComponentType().getValue(), instance.getName()); + VertexTypeEnum vertexType = ModelConverter.getVertexType(instance.getOriginType().name()); + Either getOriginRes = toscaOperationFacade.getLatestCertifiedByToscaResourceName(instance.getToscaComponentName(), vertexType, JsonParseFlagEnum.ParseMetadata); + if(getOriginRes.isRight()){ + LOGGER.info("Upgrade of {} instance {} upon upgrade migration 1710 process failed due to a reason {}. ", + component.getComponentType().getValue(), instance.getName(), getOriginRes.right().value()); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(getOriginRes.right().value(), instance.getOriginType().getComponentType()))); + } + newComponentInstance.setComponentName(getOriginRes.left().value().getName()); + newComponentInstance.setComponentUid(getOriginRes.left().value().getUniqueId()); + newComponentInstance.setComponentVersion(getOriginRes.left().value().getVersion()); + newComponentInstance.setToscaComponentName(((Resource)getOriginRes.left().value()).getToscaResourceName()); + if(isGreater(getOriginRes.left().value().getVersion(), instance.getComponentVersion())){ + return changeAssetVersion(component, instance, newComponentInstance); + } + + //upgrade nodes contained by CVFC + if(isVfcUpgradeRequired && newComponentInstance.getOriginType() == OriginTypeEnum.CVFC && + !upgradeVf(getOriginRes.left().value().getUniqueId())) { + return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + LOGGER.info("Upgrade of {} instance {} upon upgrade migration 1710 process finished successfully. ", + component.getComponentType().getValue(), instance.getName()); + return Either.left(instance); + } + + private Either upgradeServiceProxyInstance(org.openecomp.sdc.be.model.Component component, ComponentInstance instance, ComponentInstance newComponentInstance) { + Either, TitanOperationStatus> getLatestOriginServiceRes = getLatestCertifiedService(instance.getSourceModelInvariant()); + if(getLatestOriginServiceRes.isRight()){ + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(DaoStatusConverter.convertTitanStatusToStorageStatus(getLatestOriginServiceRes.right().value()), instance.getOriginType().getComponentType()))); + } + newComponentInstance.setComponentVersion((String) getLatestOriginServiceRes.left().value().get(0).getJsonMetadataField(JsonPresentationFields.VERSION)); + newComponentInstance.setSourceModelUid((String) getLatestOriginServiceRes.left().value().get(0).getJsonMetadataField(JsonPresentationFields.UNIQUE_ID)); + newComponentInstance.setSourceModelName((String) getLatestOriginServiceRes.left().value().get(0).getJsonMetadataField(JsonPresentationFields.NAME)); + newComponentInstance.setSourceModelUuid((String) getLatestOriginServiceRes.left().value().get(0).getJsonMetadataField(JsonPresentationFields.UUID)); + return changeAssetVersion(component, instance, newComponentInstance); + } + + private Either, TitanOperationStatus> getLatestCertifiedService(String invariantUUID) { + + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + propertiesToMatch.put(GraphPropertyEnum.INVARIANT_UUID, invariantUUID); + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + return titanDao.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseMetadata); + } + + private Either changeAssetVersion(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance instance, ComponentInstance newComponentInstance) { + return componentInstanceBusinessLogic.changeComponentInstanceVersion(ComponentTypeEnum.SERVICE_PARAM_NAME, containerComponent.getUniqueId(), instance.getUniqueId(), user.getUserId(), newComponentInstance); + } + + private boolean upgradeNodeTypes() { + LOGGER.info("Starting upgrade node types upon upgrade migration 1710 process. "); + String toscaConformanceLevel = ConfigurationManager.getConfigurationManager().getConfiguration().getToscaConformanceLevel(); + Map> resourcesForUpgrade = ConfigurationManager.getConfigurationManager().getConfiguration().getResourcesForUpgrade(); + Map upgradedNodeTypesMap = new HashMap<> (); + List nodeTypes; + if(resourcesForUpgrade.containsKey(toscaConformanceLevel)){ + nodeTypes = resourcesForUpgrade.get(toscaConformanceLevel); + if(nodeTypes !=null && !nodeTypes.isEmpty()){ + Either, TitanOperationStatus> getRes = getAllLatestCertifiedComponentUids(VertexTypeEnum.NODE_TYPE, ComponentTypeEnum.RESOURCE); + if(getRes.isRight()){ + return false; + } + List allNodeTypes = getRes.left().value(); + + for(String toscaResourceName: nodeTypes){ + Either, StorageOperationStatus> status = getLatestByName(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName); + if (status.isRight()) { + LOGGER.error("Failed to find node type {} ", toscaResourceName); + return false; + } + List vList = status.left().value(); + for (GraphVertex vertex : vList) { + StorageOperationStatus updateRes = upgradeNodeType(vertex, upgradedNodeTypesMap, allNodeTypes, nodeTypes); + if (updateRes != StorageOperationStatus.OK) { + return false; + } + } + } + } + } + return true; + } + + private boolean upgradeVFs() { + LOGGER.info("Starting upgrade VFs upon upgrade migration 1710 process. "); + Either, TitanOperationStatus> getVfsRes = getAllLatestCertifiedComponentUids(VertexTypeEnum.TOPOLOGY_TEMPLATE, ComponentTypeEnum.RESOURCE); + if(getVfsRes.isRight()){ + LOGGER.info(UPGRADE_VFS_FAILED); + return false; + } + for (String currUid : getVfsRes.left().value()) { + try { + if (!upgradeVf(currUid)) { + processComponentUpgradeFailure(ComponentTypeEnum.RESOURCE.name(), currUid, ""); + if (!skipIfUpgradeVfFailed) { + LOGGER.info(UPGRADE_VFS_FAILED); + return false; + } + } + titanDao.commit(); + } catch (Exception e) { + processComponentUpgradeFailure(ComponentTypeEnum.RESOURCE.name(), currUid, e.getMessage()); + if (!skipIfUpgradeVfFailed) { + LOGGER.info(UPGRADE_VFS_FAILED); + return false; + } + } + } + LOGGER.info("Upgrade VFs upon upgrade migration 1710 process finished successfully. "); + return true; + } + + private boolean upgradeVf(String uniqueId) { + LOGGER.info("Starting upgrade VF with uniqueId {} upon upgrade migration 1710 process. ", uniqueId); + Either latestVersionRes; + Either getRes = toscaOperationFacade.getToscaElement(uniqueId); + if(getRes.isRight()){ + LOGGER.debug("Failed to fetch VF with uniqueId {} upon upgrade migration 1710 process. ", uniqueId); + outputHandler.addRecord(ComponentTypeEnum.RESOURCE.name(), UNKNOWN, UNKNOWN, uniqueId, MigrationResult.MigrationStatus.FAILED.name(), getRes.right().value()); + return false; + } + if(StringUtils.isNotEmpty(getRes.left().value().getCsarUUID())){ + LOGGER.info("Going to fetch the latest version of VSP with csarUUID {} upon upgrade migration 1710 process. ", getRes.left().value().getCsarUUID()); + latestVersionRes = csarOperation.getCsarLatestVersion(getRes.left().value().getCsarUUID(), user); + if(latestVersionRes.isRight()){ + LOGGER.debug("Failed to fetch the latest version of VSP with csarUUID {} upon upgrade migration 1710 process. ", getRes.left().value().getCsarUUID()); + outputHandler.addRecord(getRes.left().value().getComponentType().name(), getRes.left().value().getName(), getRes.left().value().getUUID(), getRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(),latestVersionRes.right().value()); + return false; + } + if(isGreater(latestVersionRes.left().value(), getRes.left().value().getCsarVersion())){ + return upgradeVfWithLatestVsp(getRes.left().value(), latestVersionRes); + } + if (!isVfcUpgradeRequired){ + LOGGER.warn("Warning: No need to upgrade VF with name {}, invariantUUID {}, version {} and VSP version {}. No new version of VSP. ", getRes.left().value().getName(), getRes.left().value().getInvariantUUID(), getRes.left().value().getVersion(), getRes.left().value().getCsarVersion()); + } + } + return upgradeComponentWithLatestGeneric(getRes.left().value()); + } + + private boolean upgradeVfWithLatestVsp(org.openecomp.sdc.be.model.Component vf, Either latestVersionRes) { + LOGGER.info("Starting upgrade vf with name {}, invariantUUID {}, version {} and latest VSP version {} upon upgrade migration 1710 process. ", vf.getName(), vf.getInvariantUUID(), vf.getVersion(), latestVersionRes.left().value()); + LOGGER.info("Starting to perform check out of vf with name {}, invariantUUID {}, version {}. ", vf.getName(),vf.getInvariantUUID(), vf.getVersion()); + Either checkouRes = lifecycleBusinessLogic.changeComponentState(vf.getComponentType(), vf.getUniqueId(), user, LifeCycleTransitionEnum.CHECKOUT, changeInfo, true, false); + if(checkouRes.isRight()){ + outputHandler.addRecord(vf.getComponentType().name(), vf.getName(), vf.getUUID(), vf.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), checkouRes.right().value().getFormattedMessage()); + return false; + } + LOGGER.info("Starting update vf with name {}, invariantUUID {}, version {} and latest VSP {}. ", vf.getName(), vf.getInvariantUUID(), vf.getVersion(), latestVersionRes.left().value()); + Resource resourceToUpdate = new Resource(((Resource) checkouRes.left().value()).getComponentMetadataDefinition()); + resourceToUpdate.setDerivedFromGenericType(((Resource) checkouRes.left().value()).getDerivedFromGenericType()); + resourceToUpdate.setDerivedFromGenericVersion(((Resource) checkouRes.left().value()).getDerivedFromGenericVersion()); + resourceToUpdate.setCsarVersion(Double.toString(Double.parseDouble(latestVersionRes.left().value()))); + Either updateResourceFromCsarRes = resourceBusinessLogic.validateAndUpdateResourceFromCsar(resourceToUpdate, user, null, null, resourceToUpdate.getUniqueId()); + if(updateResourceFromCsarRes.isRight()){ + outputHandler.addRecord(resourceToUpdate.getComponentType().name(), resourceToUpdate.getName(), resourceToUpdate.getUUID(), resourceToUpdate.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), updateResourceFromCsarRes.right().value().getFormattedMessage()); + LOGGER.info("Failed to update vf with name {}, invariantUUID {}, version {} and latest VSP {}. ", vf.getName(), vf.getInvariantUUID(), vf.getVersion(), latestVersionRes.left().value()); + return false; + } + Either certifyRes = performFullCertification(checkouRes.left().value()); + if(certifyRes.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, checkouRes.left().value().getName(), checkouRes.left().value().getInvariantUUID(), checkouRes.left().value().getVersion(), LifeCycleTransitionEnum.CERTIFY); + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getInvariantUUID(), checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), certifyRes.right().value().getFormattedMessage()); + return false; + } + LOGGER.info("Full certification of vf with name {}, invariantUUID {}, version {} finished . ", vf.getName(), vf.getInvariantUUID(), vf.getVersion(), latestVersionRes.left().value()); + outputHandler.addRecord(certifyRes.left().value().getComponentType().name(), certifyRes.left().value().getName(), certifyRes.left().value().getUUID(), certifyRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.COMPLETED.name(), UpgradeStatus.UPGRADED); + return true; + } + + private boolean upgradeComponentWithLatestGeneric(org.openecomp.sdc.be.model.Component component) { + String derivedFromGenericType = component.getDerivedFromGenericType(); + String derivedFromGenericVersion = component.getDerivedFromGenericVersion(); + org.openecomp.sdc.be.model.Component updatedComponent = component; + if(StringUtils.isNotEmpty(derivedFromGenericType) && !latestGenericTypes.containsKey(derivedFromGenericType)){ + LOGGER.info("Starting upgrade vf with name {}, invariantUUID {}, version {}, latest derived from generic type {}, latest derived from generic version {}. ", component.getName(), component.getInvariantUUID(), component.getVersion(), derivedFromGenericType, derivedFromGenericVersion); + LOGGER.info("Starting to fetch latest generic node type {}. ", derivedFromGenericType); + Either, TitanOperationStatus> getDerivedRes = findDerivedResources(derivedFromGenericType); + if(getDerivedRes.isRight()){ + outputHandler.addRecord(component.getComponentType().name(), component.getName(), component.getInvariantUUID(), component.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), getDerivedRes.right().value()); + LOGGER.info("Failed to upgrade component with name {}, invariantUUID {}, version {} and latest generic. Status is {}. ", component.getName(), component.getInvariantUUID(), component.getVersion(), derivedFromGenericType); + return false; + } + latestGenericTypes.put(derivedFromGenericType, getDerivedRes.left().value().get(0)); + } + if(StringUtils.isEmpty(derivedFromGenericType) || + latestVersionExists(latestGenericTypes.get(derivedFromGenericType), derivedFromGenericVersion) || + isVfcUpgradeRequired){ + if(StringUtils.isNotEmpty(derivedFromGenericType)) + LOGGER.info("Newer version {} of derived from generic type {} exists. ", latestGenericTypes.get(derivedFromGenericType).getJsonMetadataField(JsonPresentationFields.VERSION), derivedFromGenericType); + else + LOGGER.info("The vf resource with name {}, invariantUUID {}, version {}, has an empty derivedFromGenericType field. ", component.getName(), component.getInvariantUUID(), component.getVersion()); + + LOGGER.info("Starting to perform check out of vf with name {}, invariantUUID {}, version {}. ", component.getName(), component.getInvariantUUID(), component.getVersion()); + Either checkouRes = lifecycleBusinessLogic.changeComponentState(component.getComponentType(), component.getUniqueId(), user, LifeCycleTransitionEnum.CHECKOUT, changeInfo, true, false); + if(checkouRes.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, component.getName(), component.getInvariantUUID(), component.getVersion(), LifeCycleTransitionEnum.CHECKOUT); + outputHandler.addRecord(component.getComponentType().name(), component.getName(), component.getInvariantUUID(), component.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), checkouRes.right().value().getFormattedMessage()); + return false; + } + //update included VFCs, if it is required as per configuration + if(isVfcUpgradeRequired && CollectionUtils.isNotEmpty(checkouRes.left().value().getComponentInstances())){ + LOGGER.info("VFC upgrade is required: updating components of vf with name {}, invariantUUID {}, version {}. ", component.getName(), component.getInvariantUUID(), component.getVersion()); + Either updateCompositionRes = + updateComposition(checkouRes.left().value()); + if(updateCompositionRes.isRight()){ + LOGGER.error(FAILED_TO_UPGRADE_COMPONENT, checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getInvariantUUID(), checkouRes.left().value().getVersion(), "updateComposition", updateCompositionRes.right().value().getFormattedMessage()); + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getUUID(), checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), updateCompositionRes.right().value().getFormattedMessage()); + return false; + } + } + Either certifyRes = performFullCertification(checkouRes.left().value()); + if(certifyRes.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, component.getName(), component.getInvariantUUID(), component.getVersion(), LifeCycleTransitionEnum.CERTIFY); + outputHandler.addRecord(checkouRes.left().value().getComponentType().name(), checkouRes.left().value().getName(), checkouRes.left().value().getInvariantUUID(), checkouRes.left().value().getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), certifyRes.right().value().getFormattedMessage()); + return false; + } + updatedComponent = certifyRes.left().value(); + } else { + LOGGER.info("The version {} of derived from generic type {} is up to date. No need to upgrade component with name {}, invariantUUID {} and version {}. ", latestGenericTypes.get(derivedFromGenericType), derivedFromGenericType,component.getName(), component.getInvariantUUID(), component.getVersion()); + } + LOGGER.info(UPGRADE_COMPONENT_SUCCEEDED, component.getComponentType().getValue(), component.getName(), component.getInvariantUUID(), component.getVersion()); + outputHandler.addRecord(updatedComponent.getComponentType().name(), updatedComponent.getName(), updatedComponent.getUUID(), updatedComponent.getUniqueId(), MigrationResult.MigrationStatus.COMPLETED.name(), updatedComponent.equals(component) ? UpgradeStatus.NOT_UPGRADED : UpgradeStatus.UPGRADED); + return true; + } + + private StorageOperationStatus upgradeNodeType(GraphVertex nodeTypeV, Map upgradedNodeTypesMap, List allCertifiedUids, List nodeTypes) { + StorageOperationStatus result = StorageOperationStatus.OK; + LOGGER.info("Starting upgrade node type with name {}, invariantUUID {}, version{}. ", nodeTypeV.getMetadataProperty(GraphPropertyEnum.NAME), nodeTypeV.getMetadataProperty(GraphPropertyEnum.INVARIANT_UUID), nodeTypeV.getMetadataProperty(GraphPropertyEnum.VERSION)); + LOGGER.info("Starting to find derived to for node type with name {}, invariantUUID {}, version{}. ", nodeTypeV.getMetadataProperty(GraphPropertyEnum.NAME), nodeTypeV.getMetadataProperty(GraphPropertyEnum.INVARIANT_UUID), nodeTypeV.getMetadataProperty(GraphPropertyEnum.VERSION)); + Either, TitanOperationStatus> parentResourceRes = titanDao.getParentVertecies(nodeTypeV, EdgeLabelEnum.DERIVED_FROM, JsonParseFlagEnum.ParseMetadata); + if(parentResourceRes.isRight() && parentResourceRes.right().value() != TitanOperationStatus.NOT_FOUND ){ + return DaoStatusConverter.convertTitanStatusToStorageStatus(parentResourceRes.right().value()); + + } + List derivedResourcesUid = new ArrayList<>(); + if(parentResourceRes.isLeft()){ + for(GraphVertex chV: parentResourceRes.left().value()){ + Optional op = allCertifiedUids.stream().filter(id -> id.equals((String)chV.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID))).findAny(); + if(op.isPresent()){ + derivedResourcesUid.add(chV); + } + } + } + String uniqueId = (String)nodeTypeV.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID); + Either getRes = toscaOperationFacade.getToscaElement(uniqueId); + if(getRes.isRight()){ + LOGGER.info("failed to fetch element with uniqueId {} ", uniqueId); + return getRes.right().value(); + } + + org.openecomp.sdc.be.model.Resource nt = (Resource)getRes.left().value(); + boolean isNeedToUpgrade = true; + if(upgradedNodeTypesMap.containsKey(nt.getToscaResourceName()) || nodeTypes.stream().filter( p -> p.equals(nt.getToscaResourceName())).findAny().isPresent()){ + isNeedToUpgrade = false; + } + if(isNeedToUpgrade){ + LOGGER.info("Starting to perform check out of node type with name {}, invariantUUID {}, version {}. ", nt.getName(), nt.getInvariantUUID(), nt.getVersion()); + Either checkouRes = lifecycleBusinessLogic.changeComponentState(nt.getComponentType(), nt.getUniqueId(), user, LifeCycleTransitionEnum.CHECKOUT, changeInfo, true, false); + if(checkouRes.isRight()){ + return StorageOperationStatus.GENERAL_ERROR; + } + org.openecomp.sdc.be.model.Component upgradetComp = checkouRes.left().value(); + boolean res = performFullCertification(upgradetComp).isLeft(); + if(!res){ + return StorageOperationStatus.GENERAL_ERROR; + } + upgradedNodeTypesMap.put(nt.getToscaResourceName(), upgradetComp); + titanDao.commit(); + } + for(GraphVertex chV: derivedResourcesUid){ + result = upgradeNodeType(chV, upgradedNodeTypesMap, allCertifiedUids, nodeTypes); + LOGGER.info("Upgrade node type with name {}, invariantUUID {}, version {} has been finished with the status {}", chV.getMetadataProperty(GraphPropertyEnum.NAME), chV.getMetadataProperty(GraphPropertyEnum.INVARIANT_UUID), chV.getMetadataProperty(GraphPropertyEnum.VERSION), result); + } + return result; + } + + private Either performFullCertification(org.openecomp.sdc.be.model.Component component) { + LOGGER.info("Starting to perform full certification of {} with name {}, invariantUUID {}, version {}. ", + component.getComponentType().getValue(), component.getName(), component.getInvariantUUID(), component.getVersion()); + + Either changeStateEither = lifecycleBusinessLogic.changeComponentState(component.getComponentType(), component.getUniqueId(), user, LifeCycleTransitionEnum.CERTIFICATION_REQUEST, changeInfo, true, false); + if(changeStateEither.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, component.getName(), component.getInvariantUUID(), component.getVersion(), LifeCycleTransitionEnum.CERTIFICATION_REQUEST); + return changeStateEither; + } + changeStateEither = lifecycleBusinessLogic.changeComponentState(component.getComponentType(), changeStateEither.left().value().getUniqueId(), user, LifeCycleTransitionEnum.START_CERTIFICATION, changeInfo, true, false); + if(changeStateEither.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, component.getName(), component.getInvariantUUID(), component.getVersion(), LifeCycleTransitionEnum.START_CERTIFICATION); + return changeStateEither; + } + changeStateEither = lifecycleBusinessLogic.changeComponentState(component.getComponentType(), changeStateEither.left().value().getUniqueId(), user, LifeCycleTransitionEnum.CERTIFY, changeInfo, true, false); + if(changeStateEither.isRight()){ + LOGGER.info(FAILED_TO_CHANGE_STATE_OF_COMPONENT, component.getName(), component.getInvariantUUID(), component.getVersion(), LifeCycleTransitionEnum.CERTIFY); + } + else { + LOGGER.info("Full certification of {} with name {}, invariantUUID {}, version {} finished successfully", + changeStateEither.left().value().getComponentType().getValue(), changeStateEither.left().value().getName(), + changeStateEither.left().value().getInvariantUUID(), changeStateEither.left().value().getVersion()); + } + return changeStateEither; + } + + private Either, TitanOperationStatus> findDerivedResources(String parentResource) { + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + propertiesToMatch.put(GraphPropertyEnum.TOSCA_RESOURCE_NAME, parentResource); + propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + + return titanDao.getByCriteria(VertexTypeEnum.NODE_TYPE, propertiesToMatch, JsonParseFlagEnum.ParseMetadata); + } + + private boolean latestVersionExists(GraphVertex latestDerivedFrom, String currentVersion) { + return isGreater((String)latestDerivedFrom.getJsonMetadataField(JsonPresentationFields.VERSION), currentVersion); + } + + private boolean isGreater(String latestVersion, String currentVersion) { + if(latestVersion != null && currentVersion == null) + return true; + if(latestVersion == null) + return false; + return Double.parseDouble(latestVersion) > Double.parseDouble(currentVersion); + } + + private Either, TitanOperationStatus> getAllLatestCertifiedComponentUids(VertexTypeEnum vertexType, ComponentTypeEnum componentType) { + LOGGER.info("Starting to fetch all latest certified not checked out components with type {} upon upgrade migration 1710 process", componentType); + Either, TitanOperationStatus> result = null; + Map latestCertifiedMap = new HashMap<>(); + Map latestNotCertifiedMap = new HashMap<>(); + + Either, TitanOperationStatus> getComponentsRes = getAllLatestCertifiedComponents(vertexType, componentType); + if(getComponentsRes.isRight() && getComponentsRes.right().value() != TitanOperationStatus.NOT_FOUND){ + LOGGER.error("Failed to fetch all latest certified not checked out components with type {}. Status is {}. ", componentType, getComponentsRes.right().value()); + result = Either.right(getComponentsRes.right().value()); + } + if(getComponentsRes.isRight()){ + result = Either.left(new ArrayList<>()); + } + if(result == null){ + for(GraphVertex component : getComponentsRes.left().value()){ + String invariantUUID = (String)component.getJsonMetadataField(JsonPresentationFields.INVARIANT_UUID); + if(((String)component.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals(LifecycleStateEnum.CERTIFIED.name())){ + latestCertifiedMap.put(invariantUUID, (String)component.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID)); + } else { + latestNotCertifiedMap.put(invariantUUID, (String)component.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID)); + } + } + result = Either.left(latestCertifiedMap.entrySet().stream().filter(e->!latestNotCertifiedMap.containsKey(e.getKey())).map(e->e.getValue()).collect(Collectors.toList())); + } + return result; + } + + private Either, TitanOperationStatus> getAllLatestCertifiedComponents(VertexTypeEnum vertexType, ComponentTypeEnum componentType){ + + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); + propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + if(vertexType == VertexTypeEnum.TOPOLOGY_TEMPLATE && componentType == ComponentTypeEnum.RESOURCE) + propertiesNotToMatch.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.CVFC.name()); + return titanDao.getByCriteria(vertexType, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseMetadata); + } + + protected Either, TitanOperationStatus> findResourcesPathRecursively(GraphVertex nodeTypeV, List allCertifiedUids) { + Either, TitanOperationStatus> parentResourceRes = titanDao.getParentVertecies(nodeTypeV, EdgeLabelEnum.DERIVED_FROM, JsonParseFlagEnum.ParseMetadata); + if(parentResourceRes.isRight()){ + return Either.right(parentResourceRes.right().value()); + } + List derivedResourcesUid = new ArrayList<>(); + for(GraphVertex chV: parentResourceRes.left().value()){ + Optional op = allCertifiedUids.stream().filter(id -> id.equals((String)chV.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID))).findAny(); + if(op.isPresent()){ + derivedResourcesUid.add(chV); + } + } + return null; + } + + private Either, StorageOperationStatus> getLatestByName(GraphPropertyEnum property, String nodeName){ + + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + + propertiesToMatch.put(property, nodeName); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + + Either, TitanOperationStatus> highestResources = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseMetadata); + if (highestResources.isRight()) { + TitanOperationStatus status = highestResources.right().value(); + LOGGER.debug("Failed to fetch resource with name {}. Status is {} ", nodeName, status); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + } + List resources = highestResources.left().value(); + List result = new ArrayList<>(); + for(GraphVertex component:resources){ + if(((String)component.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals(LifecycleStateEnum.CERTIFIED.name())){ + result.add(component); + } + } + return Either.left(result); + } + +} diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServlet.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServlet.java index 0ab863aa3e..898bd96177 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServlet.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServlet.java @@ -24,13 +24,11 @@ import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStream; -import java.util.Properties; import java.util.Map.Entry; +import java.util.Properties; import javax.ws.rs.Consumes; import javax.ws.rs.GET; diff --git a/asdctool/src/main/resources/config/Artifact-Generator.properties b/asdctool/src/main/resources/config/Artifact-Generator.properties new file mode 100644 index 0000000000..1d7e5fa01a --- /dev/null +++ b/asdctool/src/main/resources/config/Artifact-Generator.properties @@ -0,0 +1,264 @@ +#action widget details +AAI.model-version-id.action=fd7fb09e-d930-41b9-b83f-cfde9df48640 +AAI.model-invariant-id.action=af593b4b-490e-4665-ad74-2f6351c0a7ce +#action-data widget details +AAI.model-invariant-id.action-data=9551346c-7d8b-4daf-9926-b93e96e2344a +AAI.model-version-id.action-data=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd +#allotted-resource widget details +AAI.model-invariant-id.allotted-resource=f6d6a23d-a1a9-48ff-8419-b6530da2d381 +AAI.model-version-id.allotted-resource=7ad0915f-25c0-4a70-b9bc-185a75f87564 +#availability-zone widget details +AAI.model-version-id.availability-zone=6c092fb1-21b2-456b-9e01-67fb4de1896e +AAI.model-invariant-id.availability-zone=61b88c01-d819-41c0-8e21-7fd7ba47148e +#az-and-dvs-switches widget details +AAI.model-version-id.az-and-dvs-switches=b2dea88d-78a0-49bf-95c9-5819df08e966 +AAI.model-invariant-id.az-and-dvs-switches=53dc00d4-e6d9-48ec-b6cc-3d3797e9b896 +#class-of-service widget details +AAI.model-version-id.class-of-service=d2fb27cc-15eb-4c4e-828e-71d41aaecc5b +AAI.model-invariant-id.class-of-service=18094b19-d16d-4822-8acf-e92c6aefa178 +#cloud-region widget details +AAI.model-version-id.cloud-region=2a160989-b202-47dd-874b-4a0f275998f7 +AAI.model-invariant-id.cloud-region=425b2158-e51d-4509-9945-dad4556474a3 +#complex widget details +AAI.model-invariant-id.complex=af91c2f7-35fc-43cf-a13d-443f385b2353 +AAI.model-version-id.complex=3a8ab1ee-9220-4fe8-b89c-9251d160ddc2 +#connector widget details +AAI.model-version-id.connector=22104c9f-29fd-462f-be07-96cd6b46dd33 +AAI.model-invariant-id.connector=4c01c948-7607-4d66-8a6c-99c2c2717936 +#constrained-element-set widget details +AAI.model-invariant-id.constrained-element-set=c0292b4f-ee97-40cc-8c2e-f967c48f5701 +AAI.model-version-id.constrained-element-set=01102126-9c04-4a89-945b-b131e61e95d7 +#ctag-assignment widget details +AAI.model-version-id.ctag-assignment=44e5cb1f-0938-41aa-b766-d4595109fe89 +AAI.model-invariant-id.ctag-assignment=fcb8d46b-b656-4ad6-8fa4-22cef74b443f +#ctag-pool widget details +AAI.model-invariant-id.ctag-pool=46c51d4e-d67e-4a9c-b1f5-49b1e9c6fcaa +AAI.model-version-id.ctag-pool=2056c41f-23b9-4de7-9f50-819adad37d76 +#customer widget details +AAI.model-invariant-id.customer=c1d4305f-cdbd-4bbe-9069-a2f4978fd89e +AAI.model-version-id.customer=d4df5c27-98a1-4812-a8aa-c17f055b7a3f +#cvlan-tag-entry widget details +AAI.model-version-id.cvlan-tag-entry=c3878ffb-8d85-4114-bee6-e4074a9db10b +AAI.model-invariant-id.cvlan-tag-entry=245cf4b0-7cc5-4eea-bbd9-753e939adcab +#dvs-switch widget details +AAI.model-invariant-id.dvs-switch=98fbb471-1f86-428e-bd8a-c8a25de6fa23 +AAI.model-version-id.dvs-switch=4cb44ae8-e3ab-452a-9f95-bcc8a44c55ea +#edge-prop-names widget details +AAI.model-invariant-id.edge-prop-names=7a08cad4-8759-46a5-8245-095d1ba57ac6 +AAI.model-version-id.edge-prop-names=f0442326-8201-4d0e-857c-74b4ddcbfc9f +#element-choice-set widget details +AAI.model-invariant-id.element-choice-set=9a011958-7165-47a3-b872-00951d1f09ae +AAI.model-version-id.element-choice-set=af27fbfd-598d-44da-aeae-0f9d3a5fcd6a +#entitlement widget details +AAI.model-version-id.entitlement=7e27ba2e-b7db-4e13-9fae-d142152ef98a +AAI.model-invariant-id.entitlement=ae75b5a0-d5e1-4f3a-b8fb-37626a753da3 +#flavor widget details +AAI.model-invariant-id.flavor=bace8d1c-a261-4041-9e37-823117415d0f +AAI.model-version-id.flavor=36200fb5-f251-4f5d-a520-7c5ad5c2cd4b +#generic-vnf widget details +AAI.model-version-id.generic-vnf=93a6166f-b3d5-4f06-b4ba-aed48d009ad9 +AAI.model-invariant-id.generic-vnf=acc6edd8-a8d4-4b93-afaa-0994068be14c +#group-assignment widget details +AAI.model-invariant-id.group-assignment=7cc05f25-7ba2-42b7-a237-c5662a1689e1 +AAI.model-version-id.group-assignment=fe578080-ce19-4604-8760-fc264fbb2565 +#image widget details +AAI.model-version-id.image=f6a038c2-820c-42ba-8c2b-375e24e8f932 +AAI.model-invariant-id.image=3f4c7204-739b-4bbb-87a7-8a6856439c90 +#include-node-filter widget details +AAI.model-invariant-id.include-node-filter=2a2d8ad2-af0a-4e1f-9982-0c899e7dc827 +AAI.model-version-id.include-node-filter=f05f804d-7057-4ffe-bdc5-39f2f0c9c9fd +#instance-group widget details +AAI.model-version-id.instance-group=8e6ee9dc-9017-444a-83b3-219edb018128 +AAI.model-invariant-id.instance-group=3bf1e610-45f7-4ad6-b833-ca4c5ee6a3fd +#inventory-item widget details +AAI.model-invariant-id.inventory-item=cd57d844-9017-4078-aa19-926935a3d77c +AAI.model-version-id.inventory-item=69957f4a-2155-4b95-8d72-d6dd9b88b27b +#inventory-item-data widget details +AAI.model-version-id.inventory-item-data=0e54bb87-bd6e-4a2b-ad1c-6d935b87ae51 +AAI.model-invariant-id.inventory-item-data=87a383ae-cf03-432e-a9de-04e6a622d0fd +#ipsec-configuration widget details +AAI.model-invariant-id.ipsec-configuration=aca4c310-cb45-42bd-9f88-73e40ba7b962 +AAI.model-version-id.ipsec-configuration=d949fd10-36bf-408a-ac7a-cad5004d2e0d +#key-data widget details +AAI.model-version-id.key-data=c23ea04d-1a3b-453d-bc49-a6c783a5e92b +AAI.model-invariant-id.key-data=f5faa464-c2f2-4cc3-89d2-a90452dc3a07 +#l3-interface-ipv4-address-list widget details +AAI.model-version-id.l3-interface-ipv4-address-list=41e76b6f-1e06-4fd4-82cd-81c50fc4574b +AAI.model-invariant-id.l3-interface-ipv4-address-list=aad85df2-09be-40fa-b867-16415e4e10e2 +#l3-interface-ipv6-address-list widget details +AAI.model-invariant-id.l3-interface-ipv6-address-list=82966045-43ee-4982-8307-7e9610866140 +AAI.model-version-id.l3-interface-ipv6-address-list=d040621d-541a-477b-bb1b-a2b61b14e295 +#l3-network widget details +AAI.model-version-id.l3-network=9111f20f-e680-4001-b83f-19a2fc23bfc1 +AAI.model-invariant-id.l3-network=3d560d81-57d0-438b-a2a1-5334dba0651a +#lag-interface widget details +AAI.model-version-id.lag-interface=ce95f7c3-b61b-4758-ae9e-7e943b1c103d +AAI.model-invariant-id.lag-interface=e0ee9bde-c1fc-4651-a95d-8e0597bf7d70 +#lag-link widget details +AAI.model-version-id.lag-link=d29a087a-af59-4053-a3f8-0f95a92faa75 +AAI.model-invariant-id.lag-link=86ffe6e5-4d0e-4cec-80b5-5c38aa3eff98 +#license widget details +AAI.model-invariant-id.license=b9a9b337-1f86-42d3-b9f9-f987a089507c +AAI.model-version-id.license=6889274b-a1dc-40ab-9090-93677e13e2e6 +#license-key-resource widget details +AAI.model-invariant-id.license-key-resource=9022ebfe-b54f-4911-a6b2-8c3f5ec189b7 +AAI.model-version-id.license-key-resource=24b25f8c-b8bd-4c62-9421-87c12667aac9 +#l-interface widget details +AAI.model-version-id.l-interface=a32613fd-18b9-459e-aab8-fffb3912966a +AAI.model-invariant-id.l-interface=cea0a982-8d55-4093-921e-418fbccf7060 +#logical-link widget details +AAI.model-version-id.logical-link=a1481a38-f8ba-4ae4-bdf1-06c2c6af4c54 +AAI.model-invariant-id.logical-link=fe012535-2c31-4a39-a739-612374c638a0 +#metadatum widget details +AAI.model-invariant-id.metadatum=86dbb63a-265e-4614-993f-6771c30b56a5 +AAI.model-version-id.metadatum=6bae950e-8939-41d3-a6a7-251b03e4c1fc +#model widget details +AAI.model-invariant-id.model=06d1418a-5faa-452d-a94b-a2829df5f67b +AAI.model-version-id.model=1f51c05c-b164-4c27-9c03-5cbb239fd6be +#model-constraint widget details +AAI.model-invariant-id.model-constraint=c28966f3-e758-4483-b37b-a90b05d3dd33 +AAI.model-version-id.model-constraint=ad70dd19-f156-4fb5-a865-97b5563b0d37 +#model-element widget details +AAI.model-invariant-id.model-element=2076e726-3577-477a-a300-7fa65cd4df11 +AAI.model-version-id.model-element=753e813a-ba9e-4a1d-ab34-b2f6dc6eec0c +#multicast-configuration widget details +AAI.model-invariant-id.multicast-configuration=ea78c9e3-514d-4a0a-9162-13837fa54c35 +AAI.model-version-id.multicast-configuration=666a06ee-4b57-46df-bacf-908da8f10c3f +#named-query widget details +AAI.model-version-id.named-query=5c3b7c33-afa3-4be5-8da7-1a5ac6f99896 +AAI.model-invariant-id.named-query=80b712fd-0ad3-4180-a99c-8c995cf1cc32 +#named-query-element widget details +AAI.model-version-id.named-query-element=204c641a-3494-48c8-979a-86856f5fd32a +AAI.model-invariant-id.named-query-element=3c504d40-b847-424c-9d25-4fb7e0a3e994 +#network-policy widget details +AAI.model-invariant-id.network-policy=6aa05779-94d7-4d8b-9bee-59ef2ab0c246 +AAI.model-version-id.network-policy=a0ccd9dc-7062-4940-9bcc-e91dd28af510 +#network-profile widget details +AAI.model-version-id.network-profile=01f45471-4240-498c-a9e1-235dc0b8b4a6 +AAI.model-invariant-id.network-profile=2734b44a-b8a2-40f6-957d-6256589e5d00 +#newvce widget details +AAI.model-version-id.newvce=7c79e11f-a408-4593-aa86-ba948a1236af +AAI.model-invariant-id.newvce=4b05ec9c-c55d-4987-83ff-e08d6ddb694f +#oam-network widget details +AAI.model-invariant-id.oam-network=2851cf01-9c40-4064-87d4-6184a6fcff35 +AAI.model-version-id.oam-network=f4fb34f3-fd6e-4a8f-a3fb-4ab61a343b79 +#physical-link widget details +AAI.model-invariant-id.physical-link=c822d81f-822f-4304-9623-1025b53da568 +AAI.model-version-id.physical-link=9c523936-95b4-4d7f-9f53-6bdfe0cf2c05 +#p-interface widget details +AAI.model-invariant-id.p-interface=94043c37-4e73-439c-a790-0fdd697924cd +AAI.model-version-id.p-interface=d2cdb2d0-fc1f-4a57-a89e-591b1c4e3754 +#pnf widget details +AAI.model-version-id.pnf=e9f1fa7d-c839-418a-9601-03dc0d2ad687 +AAI.model-invariant-id.pnf=862b25a1-262a-4961-bdaa-cdc55d69785a +#port-group widget details +AAI.model-version-id.port-group=03e8bb6b-b48a-46ae-b5d4-e5af577e6844 +AAI.model-invariant-id.port-group=8ce940fb-55d7-4230-9e7f-a56cc2741f77 +#property-constraint widget details +AAI.model-version-id.property-constraint=81706bbd-981e-4362-ae20-995cbcb2d995 +AAI.model-invariant-id.property-constraint=f4a863c3-6886-470a-a6ae-05723837ea45 +#pserver widget details +AAI.model-invariant-id.pserver=6d932c8f-463b-4e76-83fb-87acfbaa2e2d +AAI.model-version-id.pserver=72f0d495-bc27-4653-9e1a-eef76bd34bc9 +#related-lookup widget details +AAI.model-invariant-id.related-lookup=468f6f5b-2996-41bb-b2a3-7cf9613ebb9b +AAI.model-version-id.related-lookup=0988bab5-bf4f-4938-a419-ab249867d12a +#reserved-prop-names widget details +AAI.model-invariant-id.reserved-prop-names=0c3e0ba3-618c-498d-9127-c8d42b00170f +AAI.model-version-id.reserved-prop-names=ac49d26d-9163-430e-934a-13b738a04f5c +#result-data widget details +AAI.model-version-id.result-data=4e9b50aa-5227-4f6f-b489-62e6bbc03c79 +AAI.model-invariant-id.result-data=ff656f23-6185-406f-9006-4b26834f3e1c +#route-table-reference widget details +AAI.model-version-id.route-table-reference=fed7e326-03a7-45ff-a3f2-471470d268c4 +AAI.model-invariant-id.route-table-reference=a8614b63-2636-4c4f-98df-fd448c4241db +#routing-instance widget details +AAI.model-invariant-id.routing-instance=1c2ded4f-8b01-4193-829c-966847dfec3e +AAI.model-version-id.routing-instance=3ccbcbc7-d19e-44d5-a52f-7e18aa8d69fa +#secondary-filter widget details +AAI.model-version-id.secondary-filter=1380619d-dd1a-4cec-b755-c6407833e065 +AAI.model-invariant-id.secondary-filter=738ff299-6290-4c00-8998-bd0e96a07b93 +#segmentation-assignment widget details +AAI.model-invariant-id.segmentation-assignment=6e814aee-46e1-4583-a9d4-0049bfd2b59b +AAI.model-version-id.segmentation-assignment=c5171ae0-44fb-4c04-b482-d56702241a44 +#service widget details +AAI.model-version-id.service=ecce2c42-3957-4ae0-9442-54bc6afe27b6 +AAI.model-invariant-id.service=07a3a60b-1b6c-4367-8173-8014386f89e3 +#service-capability widget details +AAI.model-invariant-id.service-capability=b1a7cc05-d19d-443b-a5d1-733e325c4232 +AAI.model-version-id.service-capability=f9cfec1b-18da-4bba-bd83-4b26cca115cd +#service-instance widget details +AAI.model-invariant-id.service-instance=82194af1-3c2c-485a-8f44-420e22a9eaa4 +AAI.model-version-id.service-instance=46b92144-923a-4d20-b85a-3cbd847668a9 +#service-subscription widget details +AAI.model-invariant-id.service-subscription=2e1a602a-acd8-4f78-94ff-618b802a303b +AAI.model-version-id.service-subscription=5e68299a-79f2-4bfb-8fbc-2bae877a2459 +#site-pair widget details +AAI.model-version-id.site-pair=7106bc02-6552-4fc3-8a56-4f3df9034531 +AAI.model-invariant-id.site-pair=db63f3e6-f8d1-484e-8d5e-191600b7914b +#site-pair-set widget details +AAI.model-invariant-id.site-pair-set=5d4dae3e-b402-4bfd-909e-ece12ff75d26 +AAI.model-version-id.site-pair-set=a5c6c1bc-dc38-468e-9459-bb08f87247df +#snapshot widget details +AAI.model-version-id.snapshot=962a7c8b-687f-4d32-a775-fe098e214bcd +AAI.model-invariant-id.snapshot=24de00ef-aead-4b52-995b-0adf8d4bd90d +#sriov-vf widget details +AAI.model-version-id.sriov-vf=1e8b331f-3d4a-4160-b7aa-f4d5a8916625 +AAI.model-invariant-id.sriov-vf=04b2935f-33c4-40a9-8af0-8b52690042dc +#start-node-filter widget details +AAI.model-version-id.start-node-filter=aad96fd3-e75f-42fc-9777-3450c36f1168 +AAI.model-invariant-id.start-node-filter=083093a3-e407-447a-ba5d-7583e4d23e1d +#subnet widget details +AAI.model-version-id.subnet=f902a6bc-6be4-4fe5-8458-a6ec0056b374 +AAI.model-invariant-id.subnet=1b2c9ba7-e449-4831-ba15-3073672f5ef2 +#tagged-inventory-item-list widget details +AAI.model-invariant-id.tagged-inventory-item-list=e78a7eaa-f65d-4919-9c2b-5b258c8c4d7e +AAI.model-version-id.tagged-inventory-item-list=c246f6e2-e3a1-4697-94c0-5672a7fbbf04 +#tenant widget details +AAI.model-invariant-id.tenant=97c26c99-6870-44c1-8a07-1d900d3f4ce6 +AAI.model-version-id.tenant=abcc54bc-bb74-49dc-9043-7f7171707545 +#tunnel-xconnect widget details +AAI.model-invariant-id.tunnel-xconnect=50b9e2fa-005c-4bbe-b651-3251dece4cd8 +AAI.model-version-id.tunnel-xconnect=e7cb4ca8-e1a5-4487-a716-4ae0bcd8aef5 +#update-node-key widget details +AAI.model-version-id.update-node-key=6004cfa6-eb6d-4062-971f-b1fde6b74aa0 +AAI.model-invariant-id.update-node-key=fe81c801-f65d-408a-b2b7-a729a18f8154 +#vce widget details +AAI.model-version-id.vce=b6cf54b5-ec45-43e1-be64-97b4e1513333 +AAI.model-invariant-id.vce=bab6dceb-e7e6-4301-a5e0-a7399b48d792 +#vf-module widget details +AAI.model-invariant-id.vf-module=ef86f9c5-2165-44f3-8fc3-96018b609ea5 +AAI.model-version-id.vf-module=c00563ae-812b-4e62-8330-7c4d0f47088a +#vig-server widget details +AAI.model-version-id.vig-server=8e8c22f1-fbdf-48ea-844c-8bdeb44e7b16 +AAI.model-invariant-id.vig-server=bed7c3b7-35d0-4cd9-abde-41b20e68b28e +#virtual-data-center widget details +AAI.model-invariant-id.virtual-data-center=5150abcf-0c5f-4593-9afe-a19c48fc4824 +AAI.model-version-id.virtual-data-center=6dd43ced-d789-47af-a759-d3abc14e3ac1 +#vlan widget details +AAI.model-version-id.vlan=257d88a5-a269-4c35-944f-aca04fbdb791 +AAI.model-invariant-id.vlan=d2b1eaf1-ae59-4116-9ee4-aa0179faa4f8 +#vnfc widget details +AAI.model-invariant-id.vnfc=96129eb9-f0de-4e05-8af2-73146473f766 +AAI.model-version-id.vnfc=5761e0a7-c6df-4d8a-9ebd-b8f445054dec +#vnf-image widget details +AAI.model-invariant-id.vnf-image=f9a628ff-7aa0-40e2-a93d-02d91c950982 +AAI.model-version-id.vnf-image=c4d3e747-ba4a-4b17-9896-94c6f18c19d3 +#volume widget details +AAI.model-version-id.volume=0fbe2e8f-4d91-4415-a772-88387049b38d +AAI.model-invariant-id.volume=ddd739b4-2b25-46c4-affc-41a32af5cc42 +#volume-group widget details +AAI.model-invariant-id.volume-group=fcec1b02-b2d0-4834-aef8-d71be04717dd +AAI.model-version-id.volume-group=99d44c90-1f61-4418-b9a6-56586bf38c79 +#vpe widget details +AAI.model-invariant-id.vpe=053ec3a7-5b72-492d-b54d-123805a9b967 +AAI.model-version-id.vpe=203817d3-829c-42d4-942d-2a935478e993 +#vpls-pe widget details +AAI.model-version-id.vpls-pe=b1566228-6785-4ce1-aea2-053736f80341 +AAI.model-invariant-id.vpls-pe=457ba89b-334c-4fbd-acc4-160ac0e0cdc0 +#vpn-binding widget details +AAI.model-invariant-id.vpn-binding=9e23b675-db2b-488b-b459-57aa9857baa0 +AAI.model-version-id.vpn-binding=21a146e5-9901-448c-9197-723076770119 +#vserver widget details +AAI.model-invariant-id.vserver=ff69d4e0-a8e8-4108-bdb0-dd63217e63c7 +AAI.model-version-id.vserver=8ecb2c5d-7176-4317-a255-26274edfdd53 \ No newline at end of file diff --git a/asdctool/src/main/resources/config/configuration.yaml b/asdctool/src/main/resources/config/configuration.yaml index 0421d656be..48529a7c78 100644 --- a/asdctool/src/main/resources/config/configuration.yaml +++ b/asdctool/src/main/resources/config/configuration.yaml @@ -5,10 +5,9 @@ identificationHeaderFields: - HTTP_IV_REMOTE_ADDRESS - HTTP_CSP_WSTYPE - - # catalog backend hostname -beFqdn: sdccatalog.att.com +beFqdn: localhost +# sdccatalog.att.com # catalog backend http port beHttpPort: 8080 @@ -24,25 +23,43 @@ beSslPort: 8443 version: 1.0 released: 2012-11-30 -toscaConformanceLevel: 3.0 +toscaConformanceLevel: 5.0 minToscaConformanceLevel: 3.0 -titanCfgFile: src\main\resources\config\titan.properties +# These values are necessary for running upgrade migration 1710.0 process +appVersion: 1.1.0 +artifactGeneratorConfig: Artifact-Generator.properties +resourcesForUpgrade: + 5.0: + - org.openecomp.resource.cp.extCP + - tosca.nodes.network.Network + - tosca.nodes.network.Port + - org.openecomp.resource.cp.nodes.network.SubInterface +skipUpgradeFailedVfs: true +skipUpgradeVSPs: true +autoHealingOwner: jh0003 + +titanCfgFile: C:\Users\im453s\git\sdc\asdctool\src\main\resources\config\titan.properties titanMigrationKeySpaceCfgFile: src\main\resources\config\titan-migration.properties titanInMemoryGraph: false titanLockTimeout: 1800 + +# The interval to try and reconnect to titan DB when it is down during ASDC startup: titanReconnectIntervalInSeconds: 3 + +# The read timeout towards Titan DB when health check is invoked: titanHealthCheckReadTimeout: 1 + +# The interval to try and reconnect to Elasticsearch when it is down during ASDC startup: esReconnectIntervalInSeconds: 3 uebHealthCheckReconnectIntervalInSeconds: 15 uebHealthCheckReadTimeout: 4 - # Protocols protocols: - http - https - + # Default imports defaultImports: - nodes: @@ -62,13 +79,28 @@ defaultImports: users: tom: passwd bob: passwd - + neo4j: host: neo4jhost port: 7474 user: neo4j password: "12345" - + +cassandraConfig: + cassandraHosts: ['localhost'] + localDataCenter: datacenter1 + reconnectTimeout : 30000 + authenticate: false + username: koko + password: bobo + ssl: false + truststorePath : /path/path + truststorePassword : 123123 + keySpaces: + - { name: sdcaudit, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} + - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} + - { name: sdccomponent, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} + - { name: sdcrepository, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} #Application-specific settings of ES elasticSearch: @@ -86,7 +118,7 @@ elasticSearch: # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour). # # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month. - + indicesTimeFrequency: - indexPrefix: auditingevents creationPeriod: month @@ -128,7 +160,9 @@ resourceTypes: &allResourceTypes - VL - VF - VFCMT - + - Abstract + - CVFC + # validForResourceTypes usage # validForResourceTypes: # - VF @@ -146,7 +180,7 @@ deploymentResourceArtifacts: # displayName: "Network HEAT Template" # type: HEAT_NET # validForResourceTypes: *allResourceTypes - + deploymentResourceInstanceArtifacts: heatEnv: displayName: "HEAT ENV" @@ -176,6 +210,8 @@ toscaArtifacts: #Informational artifacts placeHolder excludeResourceCategory: - Generic +excludeResourceType: + - PNF informationalResourceArtifacts: features: displayName: Features @@ -198,7 +234,7 @@ informationalResourceArtifacts: resourceSecurityTemplate: displayName: Resource Security Template type: OTHER - + excludeServiceCategory: informationalServiceArtifacts: @@ -241,7 +277,7 @@ informationalServiceArtifacts: serviceSecurityTemplate: displayName: Service Security Template type: OTHER - + serviceApiArtifacts: configuration: displayName: Configuration @@ -262,7 +298,6 @@ serviceApiArtifacts: displayName: Testing type: OTHER - additionalInformationMaxNumberOfKeys: 50 systemMonitoring: @@ -285,6 +320,10 @@ serviceDeploymentArtifacts: MODEL_QUERY_SPEC: acceptedTypes: - xml + UCPE_LAYER_2_CONFIGURATION: + acceptedTypes: + - xml + #AAI Artifacts AAI_SERVICE_MODEL: acceptedTypes: @@ -309,19 +348,19 @@ resourceDeploymentArtifacts: - yaml - yml validForResourceTypes: *allResourceTypes - HEAT_NESTED: + HEAT_NET: acceptedTypes: - yaml - yml validForResourceTypes: *allResourceTypes - HEAT_ARTIFACT: - acceptedTypes: - validForResourceTypes: *allResourceTypes - HEAT_NET: + HEAT_NESTED: acceptedTypes: - yaml - yml validForResourceTypes: *allResourceTypes + HEAT_ARTIFACT: + acceptedTypes: + validForResourceTypes: *allResourceTypes YANG_XML: acceptedTypes: - xml @@ -346,37 +385,55 @@ resourceDeploymentArtifacts: acceptedTypes: - xml validForResourceTypes: *allResourceTypes - #APPC Artifatcs + LIFECYCLE_OPERATIONS: + acceptedTypes: + - yaml + - yml + validForResourceTypes: + - VF + - VFC + VES_EVENTS: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + PERFORMANCE_COUNTER: + acceptedTypes: + - csv + validForResourceTypes: *allResourceTypes APPC_CONFIG: acceptedTypes: validForResourceTypes: - VF - #DCAE Artifacts DCAE_TOSCA: acceptedTypes: - yml - yaml validForResourceTypes: - VF + - VFCMT DCAE_JSON: acceptedTypes: - json validForResourceTypes: - VF + - VFCMT DCAE_POLICY: acceptedTypes: - emf validForResourceTypes: - VF + - VFCMT DCAE_DOC: acceptedTypes: validForResourceTypes: - - VF + - VF + - VFCMT DCAE_EVENT: acceptedTypes: validForResourceTypes: - VF -#AAI Artifacts + - VFCMT AAI_VF_MODEL: acceptedTypes: - xml @@ -390,14 +447,13 @@ resourceDeploymentArtifacts: OTHER: acceptedTypes: validForResourceTypes: *allResourceTypes -#MIB artifacts SNMP_POLL: acceptedTypes: validForResourceTypes: *allResourceTypes SNMP_TRAP: acceptedTypes: validForResourceTypes: *allResourceTypes - + resourceInstanceDeploymentArtifacts: HEAT_ENV: acceptedTypes: @@ -405,7 +461,13 @@ resourceInstanceDeploymentArtifacts: VF_MODULES_METADATA: acceptedTypes: - json -#DCAE_VF Instance Artifacts + VES_EVENTS: + acceptedTypes: + - yaml + - yml + PERFORMANCE_COUNTER: + acceptedTypes: + - csv DCAE_INVENTORY_TOSCA: acceptedTypes: - yml @@ -422,14 +484,12 @@ resourceInstanceDeploymentArtifacts: acceptedTypes: DCAE_INVENTORY_EVENT: acceptedTypes: -#MIB artifacts SNMP_POLL: acceptedTypes: validForResourceTypes: *allResourceTypes SNMP_TRAP: acceptedTypes: validForResourceTypes: *allResourceTypes - resourceInformationalArtifacts: CHEF: @@ -461,7 +521,15 @@ resourceInformationalArtifacts: validForResourceTypes: *allResourceTypes OTHER: acceptedTypes: - validForResourceTypes: *allResourceTypes + validForResourceTypes: + - VFC + - CVFC + - CP + - VL + - VF + - VFCMT + - Abstract + - PNF SNMP_POLL: acceptedTypes: validForResourceTypes: *allResourceTypes @@ -473,15 +541,14 @@ resourceInformationalArtifacts: validForResourceTypes: - VF - VFC - + - CVFC resourceInformationalDeployedArtifacts: - requirementsToFulfillBeforeCert: capabilitiesToConsumeBeforeCert: - + unLoggedUrls: - /sdc2/rest/healthCheck @@ -493,26 +560,19 @@ cleanComponentsConfiguration: artifactsIndex: resources -cassandraConfig: - cassandraHosts: ['localhost'] - localDataCenter: - reconnectTimeout : 30000 - authenticate: true - username: asdc_user - password: Aa1234%^! - ssl: false - truststorePath : /path/path - truststorePassword : 123123 - keySpaces: - - { name: sdcaudit, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} - - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} - - { name: sdccomponent, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} - - { name: sdcrepository, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} - - +heatEnvArtifactHeader: "" +heatEnvArtifactFooter: "" + +onboarding: + protocol: http + host: localhost + port: 8080 + downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" + healthCheckUri: "/onboarding-api/v1.0/healthcheck" + switchoverDetector: - gBeFqdn: AIO-BE.ecomp.idns.cip - gFeFqdn: AIO-FE.ecomp.idns.cip + gBeFqdn: AIO-BE.ecomp.idns.cip.com + gFeFqdn: AIO-FE.ecomp.idns.cip.com beVip: 0.0.0.0 feVip: 0.0.0.0 beResolveAttempts: 3 @@ -521,24 +581,14 @@ switchoverDetector: interval: 60 changePriorityUser: ecompasdc changePriorityPassword: ecompasdc123 - publishNetworkUrl: "http://xxxxxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/update_network?user=root" + publishNetworkUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/update_network?user=root" publishNetworkBody: '{"note":"publish network"}' groups: - beSet: { changePriorityUrl: "http://xxxxxxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-BE.ecomp.idns.com?user=root", + beSet: { changePriorityUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-BE.ecomp.idns.com?user=root", changePriorityBody: '{"name":"AIO-BE.ecomp.idns.com","uri":"/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-BE.ecomp.idns.com","no_ad_redirection":false,"v4groups":{"failover_groups":["/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_mg_be","/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_bs_be"],"failover_policy":["FAILALL"]},"comment":"AIO BE G-fqdn","intended_app_proto":"DNS"}'} - feSet: { changePriorityUrl: "http://cora.web.att.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-FE.ecomp.idns.cip.att.com?user=root", + feSet: { changePriorityUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-FE.ecomp.idns.com?user=root", changePriorityBody: '{"comment":"AIO G-fqdn","name":"AIO-FE.ecomp.idns.com","v4groups":{"failover_groups":["/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_mg_fe","/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_bs_fe"],"failover_policy":["FAILALL"]},"no_ad_redirection":false,"intended_app_proto":"DNS","uri":"/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-FE.ecomp.idns.com"}'} - - -heatEnvArtifactHeader: "" -heatEnvArtifactFooter: "" -onboarding: - protocol: http - host: localhost - port: 8080 - downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" - applicationL1Cache: datatypes: enabled: true @@ -546,9 +596,9 @@ applicationL1Cache: pollIntervalInSec: 60 applicationL2Cache: - enabled: false + enabled: true catalogL1Cache: - enabled: false + enabled: true resourcesSizeInCache: 300 servicesSizeInCache: 200 productsSizeInCache: 100 @@ -558,7 +608,8 @@ applicationL2Cache: numberOfCacheWorkers: 4 toscaValidators: - stringMaxLength: 65536 + stringMaxLength: 2500 + disableAudit: false vfModuleProperties: @@ -574,4 +625,10 @@ vfModuleProperties: vf_module_type: forBaseModule: Base forNonBaseModule: Expansion - \ No newline at end of file + +genericAssetNodeTypes: + VFC: org.openecomp.resource.abstract.nodes.VFC + CVFC: org.openecomp.resource.abstract.nodes.VFC + VF : org.openecomp.resource.abstract.nodes.VF + PNF: org.openecomp.resource.abstract.nodes.PNF + Service: org.openecomp.resource.abstract.nodes.service \ No newline at end of file diff --git a/asdctool/src/main/resources/config/elasticsearch.yml b/asdctool/src/main/resources/config/elasticsearch.yml index e1808ad7cc..38482e2b02 100644 --- a/asdctool/src/main/resources/config/elasticsearch.yml +++ b/asdctool/src/main/resources/config/elasticsearch.yml @@ -1,14 +1,15 @@ elasticSearch.local: true elasticSearch.transportclient: false -cluster.name: elasticsearch_1_5_2222 +cluster.name: elasticsearch discovery.zen.ping.multicast.enabled: false discovery.zen.ping.unicast.enabled: true -discovery.zen.ping.unicast.hosts: 1.2.3.4 +discovery.zen.ping.unicast.hosts: elasticsearch_host transport.client.initial_nodes: - - 1.2.3.4:9300 + - elasticsearch_host:9300 +http.cors.enabled: true #plugin.types: "DeleteByQueryPlugin" diff --git a/asdctool/src/main/resources/config/titan.properties b/asdctool/src/main/resources/config/titan.properties index e9daff7c7c..5411a44224 100644 --- a/asdctool/src/main/resources/config/titan.properties +++ b/asdctool/src/main/resources/config/titan.properties @@ -1,4 +1,11 @@ storage.backend=cassandra storage.hostname=localhost storage.port=9160 -storage.cassandra.keyspace=titan \ No newline at end of file + +cache.db-cache = false +cache.db-cache-clean-wait = 20 +cache.db-cache-time = 180000 +cache.db-cache-size = 0.5 + +cache.tx-cache-size = 500000 +storage.cassandra.keyspace=sdctitan diff --git a/asdctool/src/main/resources/elasticsearch.yml b/asdctool/src/main/resources/elasticsearch.yml new file mode 100644 index 0000000000..71ccdbb8f5 --- /dev/null +++ b/asdctool/src/main/resources/elasticsearch.yml @@ -0,0 +1,399 @@ + +cluster.name: elasticsearch + +discovery.zen.ping.multicast.enabled: false +discovery.zen.ping.unicast.enabled: true +discovery.zen.ping.unicast.hosts: elasticsearch_host + +http.cors.enabled: true + +path.home: "/home/vagrant/catalog-be/config" + +elasticSearch.transportclient: true + +transport.client.initial_nodes: + - elasticsearch_host:9300 + +#shield.user: asdc:Aa12345 +#shield.ssl.keystore.path: "/vagrant/install/resources/catalog-be/keystore/es-client.jks" +#shield.ssl.keystore.password: Aa123456 +#shield.transport.ssl: true + +##################### Elasticsearch Configuration Example ##################### + +# This file contains an overview of various configuration settings, +# targeted at operations staff. Application developers should +# consult the guide at . +# +# The installation procedure is covered at +# . +# +# Elasticsearch comes with reasonable defaults for most settings, +# so you can try it out without bothering with configuration. +# +# Most of the time, these defaults are just fine for running a production +# cluster. If you're fine-tuning your cluster, or wondering about the +# effect of certain configuration option, please _do ask_ on the +# mailing list or IRC channel [http://elasticsearch.org/community]. + +# Any element in the configuration can be replaced with environment variables +# by placing them in ${...} notation. For example: +# +# node.rack: ${RACK_ENV_VAR} + +# For information on supported formats and syntax for the config file, see +# + + +################################### Cluster ################################### + +# Cluster name identifies your cluster for auto-discovery. If you're running +# multiple clusters on the same network, make sure you're using unique names. +# +# cluster.name: elasticsearch + + +#################################### Node ##################################### + +# Node names are generated dynamically on startup, so you're relieved +# from configuring them manually. You can tie this node to a specific name: +# +# node.name: "Franz Kafka" + +# Every node can be configured to allow or deny being eligible as the master, +# and to allow or deny to store the data. +# +# Allow this node to be eligible as a master node (enabled by default): +# +# node.master: true +# +# Allow this node to store data (enabled by default): +# +# node.data: true + +# You can exploit these settings to design advanced cluster topologies. +# +# 1. You want this node to never become a master node, only to hold data. +# This will be the "workhorse" of your cluster. +# +# node.master: false +# node.data: true +# +# 2. You want this node to only serve as a master: to not store any data and +# to have free resources. This will be the "coordinator" of your cluster. +# +# node.master: true +# node.data: false +# +# 3. You want this node to be neither master nor data node, but +# to act as a "search load balancer" (fetching data from nodes, +# aggregating results, etc.) +# +# node.master: false +# node.data: false + +# Use the Cluster Health API [http://localhost:9200/_cluster/health], the +# Node Info API [http://localhost:9200/_nodes] or GUI tools +# such as , +# , +# and +# to inspect the cluster state. + +# A node can have generic attributes associated with it, which can later be used +# for customized shard allocation filtering, or allocation awareness. An attribute +# is a simple key value pair, similar to node.key: value, here is an example: +# +# node.rack: rack314 + +# By default, multiple nodes are allowed to start from the same installation location +# to disable it, set the following: +# node.max_local_storage_nodes: 1 + + +#################################### Index #################################### + +# You can set a number of options (such as shard/replica options, mapping +# or analyzer definitions, translog settings, ...) for indices globally, +# in this file. +# +# Note, that it makes more sense to configure index settings specifically for +# a certain index, either when creating it or by using the index templates API. +# +# See and +# +# for more information. + +# Set the number of shards (splits) of an index (5 by default): +# +# index.number_of_shards: 5 + +# Set the number of replicas (additional copies) of an index (1 by default): +# +# index.number_of_replicas: 1 + +# Note, that for development on a local machine, with small indices, it usually +# makes sense to "disable" the distributed features: +# +index.number_of_shards: 1 +index.number_of_replicas: 0 + +# These settings directly affect the performance of index and search operations +# in your cluster. Assuming you have enough machines to hold shards and +# replicas, the rule of thumb is: +# +# 1. Having more *shards* enhances the _indexing_ performance and allows to +# _distribute_ a big index across machines. +# 2. Having more *replicas* enhances the _search_ performance and improves the +# cluster _availability_. +# +# The "number_of_shards" is a one-time setting for an index. +# +# The "number_of_replicas" can be increased or decreased anytime, +# by using the Index Update Settings API. +# +# Elasticsearch takes care about load balancing, relocating, gathering the +# results from nodes, etc. Experiment with different settings to fine-tune +# your setup. + +# Use the Index Status API () to inspect +# the index status. + + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): +# +path.conf: /src/test/resources + +# Path to directory where to store index data allocated for this node. +# +path.data: target/esdata +# +# Can optionally include more than one location, causing data to be striped across +# the locations (a la RAID 0) on a file level, favouring locations with most free +# space on creation. For example: +# +# path.data: /path/to/data1,/path/to/data2 + +# Path to temporary files: +# +path.work: /target/eswork + +# Path to log files: +# +path.logs: /target/eslogs + +# Path to where plugins are installed: +# +# path.plugins: /path/to/plugins + + +#################################### Plugin ################################### + +# If a plugin listed here is not installed for current node, the node will not start. +# +# plugin.mandatory: mapper-attachments,lang-groovy + + +################################### Memory #################################### + +# Elasticsearch performs poorly when JVM starts swapping: you should ensure that +# it _never_ swaps. +# +# Set this property to true to lock the memory: +# +# bootstrap.mlockall: true + +# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set +# to the same value, and that the machine has enough memory to allocate +# for Elasticsearch, leaving enough memory for the operating system itself. +# +# You should also make sure that the Elasticsearch process is allowed to lock +# the memory, eg. by using `ulimit -l unlimited`. + + +############################## Network And HTTP ############################### + +# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens +# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node +# communication. (the range means that if the port is busy, it will automatically +# try the next port). + +# Set the bind address specifically (IPv4 or IPv6): +# +# network.bind_host: 192.168.0.1 + +# Set the address other nodes will use to communicate with this node. If not +# set, it is automatically derived. It must point to an actual IP address. +# +# network.publish_host: 192.168.0.1 + +# Set both 'bind_host' and 'publish_host': +# +# network.host: 192.168.0.1 + +# Set a custom port for the node to node communication (9300 by default): +# +# transport.tcp.port: 9300 + +# Enable compression for all communication between nodes (disabled by default): +# +# transport.tcp.compress: true + +# Set a custom port to listen for HTTP traffic: +# +# http.port: 9200 + +# Set a custom allowed content length: +# +# http.max_content_length: 100mb + +# Disable HTTP completely: +# +# http.enabled: false + + +################################### Gateway ################################### + +# The gateway allows for persisting the cluster state between full cluster +# restarts. Every change to the state (such as adding an index) will be stored +# in the gateway, and when the cluster starts up for the first time, +# it will read its state from the gateway. + +# There are several types of gateway implementations. For more information, see +# . + +# The default gateway type is the "local" gateway (recommended): +# +# gateway.type: local + +# Settings below control how and when to start the initial recovery process on +# a full cluster restart (to reuse as much local data as possible when using shared +# gateway). + +# Allow recovery process after N nodes in a cluster are up: +# +gateway.recover_after_nodes: 1 + +# Set the timeout to initiate the recovery process, once the N nodes +# from previous setting are up (accepts time value): +# +# gateway.recover_after_time: 5m + +# Set how many nodes are expected in this cluster. Once these N nodes +# are up (and recover_after_nodes is met), begin recovery process immediately +# (without waiting for recover_after_time to expire): +# +gateway.expected_nodes: 1 + + +############################# Recovery Throttling ############################# + +# These settings allow to control the process of shards allocation between +# nodes during initial recovery, replica allocation, rebalancing, +# or when adding and removing nodes. + +# Set the number of concurrent recoveries happening on a node: +# +# 1. During the initial recovery +# +# cluster.routing.allocation.node_initial_primaries_recoveries: 4 +# +# 2. During adding/removing nodes, rebalancing, etc +# +# cluster.routing.allocation.node_concurrent_recoveries: 2 + +# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): +# +# indices.recovery.max_bytes_per_sec: 20mb + +# Set to limit the number of open concurrent streams when +# recovering a shard from a peer: +# +# indices.recovery.concurrent_streams: 5 + + +################################## Discovery ################################## + +# Discovery infrastructure ensures nodes can be found within a cluster +# and master node is elected. Multicast discovery is the default. + +# Set to ensure a node sees N other master eligible nodes to be considered +# operational within the cluster. Its recommended to set it to a higher value +# than 1 when running more than 2 nodes in the cluster. +# +# discovery.zen.minimum_master_nodes: 1 + +# Set the time to wait for ping responses from other nodes when discovering. +# Set this option to a higher value on a slow or congested network +# to minimize discovery failures: +# +# discovery.zen.ping.timeout: 3s + +# For more information, see +# + +# Unicast discovery allows to explicitly control which nodes will be used +# to discover the cluster. It can be used when multicast is not present, +# or to restrict the cluster communication-wise. +# +# 1. Disable multicast discovery (enabled by default): +# +# discovery.zen.ping.multicast.enabled: false +# +# 2. Configure an initial list of master nodes in the cluster +# to perform discovery when new nodes (master or data) are started: +# +# discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] + +# EC2 discovery allows to use AWS EC2 API in order to perform discovery. +# +# You have to install the cloud-aws plugin for enabling the EC2 discovery. +# +# For more information, see +# +# +# See +# for a step-by-step tutorial. + +# GCE discovery allows to use Google Compute Engine API in order to perform discovery. +# +# You have to install the cloud-gce plugin for enabling the GCE discovery. +# +# For more information, see . + +# Azure discovery allows to use Azure API in order to perform discovery. +# +# You have to install the cloud-azure plugin for enabling the Azure discovery. +# +# For more information, see . + +################################## Slow Log ################################## + +# Shard level query and fetch threshold logging. + +#index.search.slowlog.threshold.query.warn: 10s +#index.search.slowlog.threshold.query.info: 5s +#index.search.slowlog.threshold.query.debug: 2s +#index.search.slowlog.threshold.query.trace: 500ms + +#index.search.slowlog.threshold.fetch.warn: 1s +#index.search.slowlog.threshold.fetch.info: 800ms +#index.search.slowlog.threshold.fetch.debug: 500ms +#index.search.slowlog.threshold.fetch.trace: 200ms + +#index.indexing.slowlog.threshold.index.warn: 10s +#index.indexing.slowlog.threshold.index.info: 5s +#index.indexing.slowlog.threshold.index.debug: 2s +#index.indexing.slowlog.threshold.index.trace: 500ms + +################################## GC Logging ################################ + +#monitor.jvm.gc.young.warn: 1000ms +#monitor.jvm.gc.young.info: 700ms +#monitor.jvm.gc.young.debug: 400ms + +#monitor.jvm.gc.old.warn: 10s +#monitor.jvm.gc.old.info: 5s +#monitor.jvm.gc.old.debug: 2s + diff --git a/asdctool/src/main/resources/scripts/UUIDFix1707.sh b/asdctool/src/main/resources/scripts/UUIDFix1707.sh index d6bd8e8ff8..0ceb0a0346 100644 --- a/asdctool/src/main/resources/scripts/UUIDFix1707.sh +++ b/asdctool/src/main/resources/scripts/UUIDFix1707.sh @@ -16,9 +16,9 @@ fi source ${FULL_PATH}/baseOperation.sh -mainClass="org.openecomp.sdc.asdctool.main.MigrationMenu" +mainClass="org.openecomp.sdc.asdctool.main.ArtifactUUIDFixMenu" -command="java $JVM_LOG_FILE -cp $JARS $mainClass fix-UUID-1707 1707 $@" +command="java $JVM_LOG_FILE -cp $JARS $mainClass $@" echo $command $command diff --git a/asdctool/src/main/resources/scripts/artifactsIdValidation.sh b/asdctool/src/main/resources/scripts/artifactsIdValidation.sh new file mode 100644 index 0000000000..9064a64c6d --- /dev/null +++ b/asdctool/src/main/resources/scripts/artifactsIdValidation.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +############################## +# Artifact Validator Tool # +############################## + +CURRENT_DIR=`pwd` +BASEDIR=$(dirname $0) + +if [ ${BASEDIR:0:1} = "/" ] +then + FULL_PATH=$BASEDIR +else + FULL_PATH=$CURRENT_DIR/$BASEDIR +fi + +source ${FULL_PATH}/baseOperation.sh + +mainClass="org.openecomp.sdc.asdctool.main.ArtifactValidatorTool" + +command="java $JVM_LOG_FILE -cp $JARS $mainClass /var/tmp/ /home/vagrant/catalog-be/config/catalog-be/" +#command="java $JVM_LOG_FILE -cp $JARS $mainClass . /apps/jetty/base/be/config/catalog-be/" +echo $command + +$command +result=$? + +echo "***********************************" +echo "***** $result *********************" +echo "***********************************" + +exit $result \ No newline at end of file diff --git a/asdctool/src/main/resources/scripts/sdc-migration.sh b/asdctool/src/main/resources/scripts/sdc-migration.sh index 1616890217..bbdd6f0f7b 100644 --- a/asdctool/src/main/resources/scripts/sdc-migration.sh +++ b/asdctool/src/main/resources/scripts/sdc-migration.sh @@ -4,6 +4,9 @@ # Data Migration ############################## +# in 1802E we do not want to execute automatic post process +exit 0 + CURRENT_DIR=`pwd` BASEDIR=$(dirname $0) diff --git a/asdctool/src/main/resources/scripts/upgradePostMigration1710.sh b/asdctool/src/main/resources/scripts/upgradePostMigration1710.sh new file mode 100644 index 0000000000..927d148d88 --- /dev/null +++ b/asdctool/src/main/resources/scripts/upgradePostMigration1710.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +############################## +# Data Migration: Upgrade Post Migration 1710 +############################## + +CURRENT_DIR=`pwd` +BASEDIR=$(dirname $0) + +if [ ${BASEDIR:0:1} = "/" ] +then + FULL_PATH=$BASEDIR +else + FULL_PATH=$CURRENT_DIR/$BASEDIR +fi + +source ${FULL_PATH}/baseOperation.sh + +mainClass="org.openecomp.sdc.asdctool.migration.main.MigrationMenu" + +command="java $JVM_LOG_FILE -cp $JARS $mainClass -c $@" +echo $command + +$command +result=$? + +echo "***********************************" +echo "***** $result *********************" +echo "***********************************" + +exit $result + + diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java index 5afabc5639..a84c74d2f5 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.enums; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java index 775006bfdc..6adbdccf1d 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.asdctool.impl.validator.config; import java.util.Properties; -import javax.annotation.Generated; - import org.junit.Test; @@ -21,16 +19,6 @@ public class ValidationConfigManagerTest { // default test result = ValidationConfigManager.getOutputFilePath(); } - - - @Test - public void testSetOutputFilePath() throws Exception { - String outputPath = ""; - - // default test - ValidationConfigManager.setOutputFilePath(outputPath); - } - @Test public void testGetCsvReportFilePath() throws Exception { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java index f220fa149a..fb916541c0 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.config; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; @@ -10,7 +8,6 @@ import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ArtifactValidat import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ServiceArtifactValidationTask; import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.VfArtifactValidationTask; import org.openecomp.sdc.asdctool.impl.validator.tasks.moduleJson.ModuleJsonTask; -import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; import org.openecomp.sdc.be.dao.TitanClientStrategy; import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao; import org.openecomp.sdc.be.dao.cassandra.CassandraClient; @@ -20,7 +17,6 @@ import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; import org.openecomp.sdc.be.model.jsontitan.operations.CategoryOperation; import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation; -import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.NodeTypeOperation; import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaDataOperation; @@ -99,18 +95,6 @@ public class ValidationToolConfigurationTest { testSubject = createTestSubject(); result = testSubject.basicVfValidator(); } - - - @Test - public void testReportManager() throws Exception { - ValidationToolConfiguration testSubject; - ReportManager result; - - // default test - testSubject = createTestSubject(); - result = testSubject.reportManager(); - } - @Test public void testArtifactCassandraDao() throws Exception { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java index 344c439f4b..05acd9aa6f 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java index 523b9ac077..3747d7fd09 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java @@ -1,11 +1,6 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import java.util.List; - import org.junit.Test; -import org.openecomp.sdc.asdctool.impl.validator.tasks.TopologyTemplateValidationTask; -import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; public class TopologyTemplateValidatorExecuterTest { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java index 0d75c4d8b2..12136df609 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java index ba1bd72fb7..8ba509cf9c 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java index cdada41b92..ef0b23bc59 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java @@ -1,11 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; -import javax.annotation.Generated; - -import org.junit.Test; -import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; - - public class ServiceArtifactValidationTaskTest { private ServiceArtifactValidationTask createTestSubject() { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java index 554e58d9d5..04aec47ebb 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java @@ -1,12 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; -import javax.annotation.Generated; - -import org.junit.Test; -import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult; -import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; - - public class VfArtifactValidationTaskTest { private VfArtifactValidationTask createTestSubject() { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java index 6e72a31421..7467699fc0 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java index 96eedcf1fd..d51075bc89 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java index 3b88a683ed..9b44eef1f5 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java index e8641097b6..c97bffc4d8 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.migration.config; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.asdctool.migration.core.SdcMigrationTool; import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/DBVersionTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/DBVersionTest.java index 4e5fd3ab31..afdd0d6da8 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/DBVersionTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/DBVersionTest.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.asdctool.migration.core; +import static org.testng.Assert.assertEquals; + import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; - public class DBVersionTest { diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java index b1813227e2..fe74891950 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java @@ -1,5 +1,12 @@ package org.openecomp.sdc.asdctool.migration.core; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.Collections; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; @@ -12,13 +19,6 @@ import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.util.Arrays; -import java.util.Collections; - -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class SdcMigrationToolTest { @InjectMocks diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java index 7d8cc5aa78..9547abc00f 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java @@ -1,14 +1,13 @@ package org.openecomp.sdc.asdctool.migration.core.execution; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; + import org.openecomp.sdc.asdctool.migration.DummyMigrationFactory; -import org.openecomp.sdc.asdctool.migration.core.DBVersion; import org.openecomp.sdc.asdctool.migration.core.task.Migration; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - public class MigrationExecutorImplTest { @Test diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java index 31af99c64d..04a8bd213b 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.migration.core.task; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult.MigrationStatus; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java index 6084608f0e..360b3aab40 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java @@ -1,23 +1,24 @@ package org.openecomp.sdc.asdctool.migration.resolver; +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.openecomp.sdc.asdctool.migration.core.DBVersion; +import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage; import org.openecomp.sdc.asdctool.migration.core.task.Migration; import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import static org.mockito.Mockito.when; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - public class SpringBeansMigrationResolverTest { @InjectMocks @@ -38,7 +39,8 @@ public class SpringBeansMigrationResolverTest { @Test public void testResolveMigrations_getMigrationsWithVersionGreaterThanLatest() throws Exception { when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.2")); - List resolvedMigrations = testInstance.resolveMigrations(); + testInstance.setPostMigrations(Collections.emptyList()); + List resolvedMigrations = testInstance.resolveMigrations(); assertEquals(resolvedMigrations.size(), 2); assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.3")); assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.22")); @@ -47,7 +49,8 @@ public class SpringBeansMigrationResolverTest { @Test public void testResolveMigration_noLatestVersionForCurrentMajorVersion() throws Exception { when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1")); - List resolvedMigrations = testInstance.resolveMigrations(); + testInstance.setPostMigrations(Collections.emptyList()); + List resolvedMigrations = testInstance.resolveMigrations(); assertEquals(resolvedMigrations.size(), 3); assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.1")); assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.3")); @@ -57,8 +60,9 @@ public class SpringBeansMigrationResolverTest { @Test public void testResolveMigrations_emptyMigrationsList() throws Exception { testInstance.setMigrations(Collections.emptyList()); + testInstance.setPostMigrations(Collections.emptyList()); when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1")); - List resolvedMigrations = testInstance.resolveMigrations(); + List resolvedMigrations = testInstance.resolveMigrations(); assertTrue(resolvedMigrations.isEmpty()); } diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/scanner/ClassScanner.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/scanner/ClassScanner.java index a2bf623b83..c50cae0673 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/scanner/ClassScanner.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/scanner/ClassScanner.java @@ -1,8 +1,5 @@ package org.openecomp.sdc.asdctool.migration.scanner; -import org.apache.commons.io.FileUtils; -import org.openecomp.sdc.asdctool.migration.core.MigrationException; - import java.io.File; import java.lang.reflect.Modifier; import java.net.URL; @@ -12,6 +9,9 @@ import java.util.Collections; import java.util.List; import java.util.Optional; +import org.apache.commons.io.FileUtils; +import org.openecomp.sdc.asdctool.migration.core.MigrationException; + /** * scan and instantiate classes of given type in the class path */ diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java index 705f8d13e6..31e1a63689 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java @@ -1,5 +1,11 @@ package org.openecomp.sdc.asdctool.migration.service; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + +import java.math.BigInteger; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -10,12 +16,6 @@ import org.openecomp.sdc.be.resources.data.MigrationTaskEntry; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.math.BigInteger; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.testng.Assert.assertEquals; - public class SdcRepoServiceTest { @InjectMocks diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java index 037d51ba12..fa61b7e19e 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java @@ -1,5 +1,11 @@ package org.openecomp.sdc.asdctool.migration.task; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + import org.apache.commons.lang.StringUtils; import org.openecomp.sdc.asdctool.migration.core.DBVersion; import org.openecomp.sdc.asdctool.migration.core.task.Migration; @@ -9,13 +15,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - - public class MigrationTasksTest { public static final String MIGRATIONS_BASE_PACKAGE = "org.openecomp.sdc.asdctool.migration.tasks"; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java new file mode 100644 index 0000000000..2cb5e2999c --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java @@ -0,0 +1,265 @@ +package org.openecomp.sdc.asdctool.migration.tasks.mig1710; + + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; +import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.IUserAdminOperation; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.exception.ResponseFormat; + +import com.google.common.collect.Lists; + +import fj.data.Either; + +@RunWith(MockitoJUnitRunner.class) +public class UpgradeMigration1710Test { + + private final static String USER = "jh0003"; + private final static String CONF_LEVEL = "5.0"; + + private final User user = new User(); + private UpgradeMigration1710 migration; + @Mock + private IUserAdminOperation userAdminOperation; + @Mock + private ToscaOperationFacade toscaOperationFacade; + @Mock + private LifecycleBusinessLogic lifecycleBusinessLogic; + @Mock + private TitanDao titanDao; + @Mock + private ComponentsUtils componentUtils; + @Mock + private ConfigurationSource configurationSource; + private static ConfigurationManager configurationManager; + private static List resources = Stream.of("org.openecomp.resource.cp.extCP").collect(Collectors.toList()); + private static Map> resourcesForUpgrade; + + @BeforeClass + public static void setUpClass() { + resourcesForUpgrade = new HashMap<>(); + resourcesForUpgrade.put(CONF_LEVEL, resources); + } + + @Before + public void setUp() { + migration = new UpgradeMigration1710(); + migration.setUserAdminOperation(userAdminOperation); + migration.setTitanDao(titanDao); + migration.setTosckaOperationFacade(toscaOperationFacade); + migration.setLifecycleBusinessLogic(lifecycleBusinessLogic); + + user.setUserId(USER); + configurationManager = new ConfigurationManager(configurationSource); + configurationManager.setConfiguration(new Configuration()); + configurationManager.getConfiguration().setSkipUpgradeVSPs(true); + configurationManager.getConfiguration().setSkipUpgradeFailedVfs(true); + configurationManager.getConfiguration().setAutoHealingOwner(USER); + + } + + @Test + public void nodeTypesUpgradeFailed() { + resolveUserAndDefineUpgradeLevel(); + when(titanDao.getByCriteria(any(), any(), any(), any())) + .thenReturn(Either.right(TitanOperationStatus.NOT_FOUND)); + assertEquals(MigrationResult.MigrationStatus.FAILED, migration.migrate().getMigrationStatus()); + } + + @Test + public void nodeTypesUpgradePassedAndVFsUpgradeFailedWhenSkipFailedVFsIsNotSupported() { + final boolean failOnVfUpgrade = true; + final boolean upgradeServices = false; + final boolean exceptionOnVfUpgrade = false; + final boolean upgradeFVC = false; + configurationManager.getConfiguration().setSkipUpgradeFailedVfs(false); + resolveUserAndDefineUpgradeLevel(); + upgradeRules(failOnVfUpgrade, exceptionOnVfUpgrade, upgradeServices, upgradeFVC); + assertEquals(MigrationResult.MigrationStatus.FAILED, migration.migrate().getMigrationStatus()); + } + + @Test + public void upgradeAllVFsUpgradeFailedOnExceptionWhenSkipFailedVFsIsNotSupported() { + final boolean failOnVfUpgrade = false; + final boolean upgradeServices = false; + final boolean exceptionOnVfUpgrade = true; + final boolean upgradeFVC = false; + configurationManager.getConfiguration().setSkipUpgradeFailedVfs(false); + resolveUserAndDefineUpgradeLevel(); + upgradeRules(failOnVfUpgrade, exceptionOnVfUpgrade, upgradeServices, upgradeFVC); + assertEquals(MigrationResult.MigrationStatus.FAILED, migration.migrate().getMigrationStatus()); + } + + @Test + public void upgradeAllIfVFsUpgradeFailedOnExceptionWhenSkipFailedVFsIsSupported() { + final boolean failOnVfUpgrade = false; + final boolean upgradeServices = true; + final boolean exceptionOnFvUpgrade = true; + final boolean upgradeFVC = false; + configurationManager.getConfiguration().setSkipUpgradeFailedVfs(true); + resolveUserAndDefineUpgradeLevel(); + upgradeRules(failOnVfUpgrade, exceptionOnFvUpgrade, upgradeServices, upgradeFVC); + assertEquals(MigrationResult.MigrationStatus.COMPLETED, migration.migrate().getMigrationStatus()); + } + + + @Test + public void upgradeAll() { + final boolean failOnVfUpgrade = false; + final boolean upgradeServices = true; + final boolean exceptionOnFvUpgrade = false; + final boolean upgradeFVC = false; + resolveUserAndDefineUpgradeLevel(); + upgradeRules(failOnVfUpgrade, exceptionOnFvUpgrade, upgradeServices, upgradeFVC); + assertEquals(MigrationResult.MigrationStatus.COMPLETED, migration.migrate().getMigrationStatus()); + } + + @Test + public void upgradeAllWhenVspUpgradeIsRequired() { + final boolean failOnVfUpgrade = false; + final boolean upgradeServices = true; + final boolean exceptionOnFvUpgrade = false; + final boolean upgradeFVC = true; + resolveUserAndDefineUpgradeLevel(); + upgradeRules(failOnVfUpgrade, exceptionOnFvUpgrade, upgradeServices, upgradeFVC); + configurationManager.getConfiguration().setSkipUpgradeVSPs(false); + migration.setComponentsUtils(componentUtils); + assertEquals(MigrationResult.MigrationStatus.COMPLETED, migration.migrate().getMigrationStatus()); + } + + @Test + public void migrationFailedWhenUserNotResolved() { + when(userAdminOperation.getUserData(anyString(), eq(false))).thenReturn(Either.right(ActionStatus.MISSING_INFORMATION)); + when(titanDao.rollback()).thenReturn(TitanOperationStatus.OK); + assertEquals(MigrationResult.MigrationStatus.FAILED, migration.migrate().getMigrationStatus()); + } + + private void resolveUserAndDefineUpgradeLevel() { + when(userAdminOperation.getUserData(anyString(), eq(false))).thenReturn(Either.left(user)); + configurationManager.getConfiguration().setToscaConformanceLevel(CONF_LEVEL); + configurationManager.getConfiguration().setResourcesForUpgrade(resourcesForUpgrade); + } + + private void upgradeRules(boolean failedVfUpgrade, boolean exceptionOnVfUpgrade, boolean upgradeService, boolean upgradeVFCs) { + GraphVertex component = new GraphVertex(); + component.setJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE, LifecycleStateEnum.CERTIFIED.name()); + component.setJsonMetadataField(JsonPresentationFields.UNIQUE_ID, "12345"); + List components = Lists.newArrayList(); + components.add(component); + + Resource resource = new Resource(); + Either foundResource = Either.left(resource); + + when(titanDao.getByCriteria(any(), any(), any(), any())) + .thenReturn(Either.left(components)); + when(titanDao.getParentVertecies(any(), any(), any())) + //1th node to upgrade + .thenReturn(Either.left(components)) + //parent of the 1th node - stop recursion + .thenReturn(Either.right(TitanOperationStatus.NOT_FOUND)); + if (failedVfUpgrade) { + Either getToscaForVF = Either.right(StorageOperationStatus.NOT_FOUND); + when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(foundResource) + .thenReturn(foundResource) + .thenReturn(getToscaForVF); + } + else { + if (exceptionOnVfUpgrade) { + when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(foundResource) + .thenReturn(foundResource) + .thenThrow(new RuntimeException()); + } + else { + when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(foundResource); + //happy flow + if (upgradeService) { + Either service = Either.left(resource); + if (upgradeVFCs) { + when(componentUtils.convertFromStorageResponse(any(), any())).thenCallRealMethod(); + when(componentUtils.getResponseFormat(any(ActionStatus.class),any())).thenCallRealMethod(); + when(toscaOperationFacade.getLatestCertifiedByToscaResourceName(any(), any(), any())) + .thenReturn(service) + .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND)) + .thenReturn(service) + .thenReturn(Either.right(StorageOperationStatus.NOT_FOUND)); + } + else { + when(toscaOperationFacade.getLatestCertifiedByToscaResourceName(any(), any(), any())) + .thenReturn(service); + } + } + } + } + List instances = Lists.newArrayList(); + instances.add(createComponentInstance()); + resource.setComponentInstances(instances); + Either fromLifeCycle = Either.left(resource); + doReturn(fromLifeCycle).when(lifecycleBusinessLogic) + .changeComponentState(any(), any(), any(), any(), any(),eq(true), eq(false)); + + } + + private ComponentInstance createComponentInstance() { + ComponentInstance instance = new ComponentInstance(); + instance.setIcon(""); + instance.setUniqueId(""); + instance.setName(""); + instance.setComponentUid(""); + instance.setCreationTime(1L); + instance.setModificationTime(2L); + instance.setDescription(""); + instance.setPosX(""); + instance.setPosY(""); + instance.setPropertyValueCounter(1); + instance.setNormalizedName(""); + instance.setOriginType(OriginTypeEnum.CVFC); + instance.setCustomizationUUID(""); + instance.setComponentName(""); + instance.setComponentVersion(""); + instance.setToscaComponentName(""); + instance.setInvariantName(""); + instance.setSourceModelInvariant(""); + instance.setSourceModelName(""); + instance.setSourceModelUuid(""); + instance.setSourceModelUid(""); + instance.setIsProxy(false); + return instance; + } + + +} diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java index c3f7874c12..217bc3919f 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.asdctool.servlets; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/.gitignore b/catalog-be/.gitignore deleted file mode 100644 index fbfe5d3901..0000000000 --- a/catalog-be/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/target -/target -/target - -/target -/target -/target -/build diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml index 5b13e028d8..73194b66d3 100644 --- a/catalog-be/pom.xml +++ b/catalog-be/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 catalog-be @@ -16,10 +15,7 @@ 2.1.0-M2 - - - com.fasterxml.jackson.dataformat @@ -556,9 +552,13 @@ org.mockito - mockito-all - ${mockito.version} - + mockito-core + test + + + + org.assertj + assertj-core test @@ -623,53 +623,6 @@ - - maven-resources-plugin - 2.6 - - - copy-tosca-folder - - install - - copy-resources - - - ${project.parent.basedir}/asdctool/tosca - - - ${project.parent.basedir}/catalog-be/src/main/resources/import/tosca - true - - - - - - - - - maven-clean-plugin - 3.0.0 - - - clean-static-files - clean - - clean - - - - - - ${project.parent.basedir}/asdctool/tosca - false - - - - - - - org.apache.maven.plugins maven-assembly-plugin diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/api/IAuditingManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/api/IAuditingManager.java index 36b79c2d9c..b6cd4320f4 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/api/IAuditingManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/api/IAuditingManager.java @@ -22,8 +22,6 @@ package org.openecomp.sdc.be.auditing.api; import java.util.EnumMap; -import javax.servlet.ServletContext; - import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; public interface IAuditingManager { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatConstants.java b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatConstants.java index 8ff3fca4f8..ed0fd6de0e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatConstants.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatConstants.java @@ -20,14 +20,13 @@ package org.openecomp.sdc.be.auditing.impl; -import org.apache.commons.lang3.StringUtils; -import org.openecomp.sdc.be.components.impl.ImportUtils; -import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; -public interface AuditingLogFormatConstants { +class AuditingLogFormatConstants { - static AuditingFieldsKeysEnum[] DISTRIBUTION_REGISTRATION_TEMPLATE_ARRAY = { + private AuditingLogFormatConstants() {} + + static final AuditingFieldsKeysEnum[] DISTRIBUTION_REGISTRATION_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_API_KEY, @@ -37,7 +36,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_NOTIFICATION_TOPIC_NAME, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_TOPIC_NAME}; - static AuditingFieldsKeysEnum[] DISTRIBUTION_DOWNLOAD_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] DISTRIBUTION_DOWNLOAD_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, @@ -45,7 +44,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] GET_UEB_CLUSTER_ARRAY = { + static final AuditingFieldsKeysEnum[] GET_UEB_CLUSTER_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_TIME, @@ -53,7 +52,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_STATUS_DESC }; - static AuditingFieldsKeysEnum[] DISTRIBUTION_DEPLOY_ARRAY = { + static final AuditingFieldsKeysEnum[] DISTRIBUTION_DEPLOY_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -65,7 +64,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] DISTRIBUTION_STATUS_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] DISTRIBUTION_STATUS_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, @@ -76,7 +75,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] DISTRIBUTION_NOTIFY_ARRAY = { + static final AuditingFieldsKeysEnum[] DISTRIBUTION_NOTIFY_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -90,7 +89,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] ADD_REMOVE_TOPIC_KEY_ACL_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] ADD_REMOVE_TOPIC_KEY_ACL_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ENVRIONMENT_NAME, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_TOPIC_NAME, @@ -99,14 +98,14 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_STATUS }; - static AuditingFieldsKeysEnum[] CREATE_TOPIC_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] CREATE_TOPIC_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ENVRIONMENT_NAME, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_TOPIC_NAME, AuditingFieldsKeysEnum.AUDIT_STATUS }; - static AuditingFieldsKeysEnum[] ACTIVATE_DISTRIBUTION_ARRAY ={ + static final AuditingFieldsKeysEnum[] ACTIVATE_DISTRIBUTION_ARRAY ={ AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -121,7 +120,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] CHANGE_DISTRIBUTION_STATUS_ARRAY = { + static final AuditingFieldsKeysEnum[] CHANGE_DISTRIBUTION_STATUS_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -136,12 +135,12 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_RESOURCE_COMMENT }; - static AuditingFieldsKeysEnum[] CREATE_RESOURCE_TEMPLATE_SUFFIX_ARRAY = { + static final AuditingFieldsKeysEnum[] CREATE_RESOURCE_TEMPLATE_SUFFIX_ARRAY = { AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] CREATE_RESOURCE_TEMPLATE_PREFIX_ARRAY = { + static final AuditingFieldsKeysEnum[] CREATE_RESOURCE_TEMPLATE_PREFIX_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -155,14 +154,14 @@ public interface AuditingLogFormatConstants { }; - static AuditingFieldsKeysEnum[] USER_ACCESS_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] USER_ACCESS_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_USER_UID, AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] USER_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] USER_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_USER_UID, @@ -170,7 +169,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] AUTH_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] AUTH_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_AUTH_URL, AuditingFieldsKeysEnum.AUDIT_AUTH_USER, @@ -178,7 +177,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_AUTH_REALM }; - static AuditingFieldsKeysEnum[] ECOMP_USER_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] ECOMP_USER_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_ECOMP_USER, @@ -186,7 +185,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] CATEGORY_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] CATEGORY_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_CATEGORY_NAME, @@ -197,7 +196,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] GET_USERS_LIST_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] GET_USERS_LIST_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_USER_DETAILS, @@ -205,14 +204,14 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] GET_CATEGORY_HIERARCHY_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] GET_CATEGORY_HIERARCHY_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_DETAILS, AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] USER_ADMIN_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] USER_ADMIN_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_MODIFIER_UID, AuditingFieldsKeysEnum.AUDIT_USER_BEFORE, @@ -220,14 +219,14 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_GET_ASSET_LIST_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_GET_ASSET_LIST_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_GET_ASSET_TEMPLATE_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_GET_ASSET_TEMPLATE_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, @@ -237,13 +236,13 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_DOWNLOAD_ARTIFACT_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_DOWNLOAD_ARTIFACT_ARRAY = { AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, AuditingFieldsKeysEnum.AUDIT_STATUS, AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_CRUD_API_ARTIFACT_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_CRUD_API_ARTIFACT_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -257,7 +256,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_CRUD_API_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_CRUD_API_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, @@ -278,7 +277,7 @@ public interface AuditingLogFormatConstants { AuditingFieldsKeysEnum.AUDIT_DESC }; - static AuditingFieldsKeysEnum[] EXTERNAL_LYFECYCLE_API_ARRAY = { + static final AuditingFieldsKeysEnum[] EXTERNAL_LYFECYCLE_API_ARRAY = { AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtil.java index b965516df8..8fb5c4116e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtil.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditingLogFormatUtil.java @@ -24,9 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.EnumMap; import java.util.Formatter; -import java.util.HashSet; import java.util.Locale; -import java.util.Set; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.common.api.Constants; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTask.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTask.java index b3b842b9e4..824b70073e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTask.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTask.java @@ -162,7 +162,7 @@ public class AsdcComponentsCleanerTask implements Runnable { public void run() { try { componentsCleanBusinessLogic.cleanComponents(componentsToClean); - } catch (Throwable e) { + } catch (Exception e) { log.error("unexpected error occured", e); String methodName = new Object() { }.getClass().getEnclosingMethod().getName(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java index e6d15b8d5e..c496715a02 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java @@ -25,14 +25,12 @@ import java.net.MalformedURLException; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.att.nsa.cambria.client.*; import org.apache.http.HttpStatus; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; @@ -43,189 +41,34 @@ import org.slf4j.LoggerFactory; import com.att.nsa.apiClient.http.HttpException; import com.att.nsa.apiClient.http.HttpObjectNotFoundException; +import com.att.nsa.cambria.client.CambriaBatchingPublisher; +import com.att.nsa.cambria.client.CambriaClient; import com.att.nsa.cambria.client.CambriaClient.CambriaApiException; -import com.att.nsa.cambria.client.CambriaClientBuilders.TopicManagerBuilder; -import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder; +import com.att.nsa.cambria.client.CambriaClientBuilders; import com.att.nsa.cambria.client.CambriaClientBuilders.ConsumerBuilder; import com.att.nsa.cambria.client.CambriaClientBuilders.IdentityManagerBuilder; +import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder; +import com.att.nsa.cambria.client.CambriaClientBuilders.TopicManagerBuilder; +import com.att.nsa.cambria.client.CambriaConsumer; +import com.att.nsa.cambria.client.CambriaIdentityManager; import com.att.nsa.cambria.client.CambriaPublisher.message; +import com.att.nsa.cambria.client.CambriaTopicManager; import com.google.gson.Gson; import fj.data.Either; -import jline.internal.Log; public class CambriaHandler { private static Logger logger = LoggerFactory.getLogger(CambriaHandler.class.getName()); - public static String PARTITION_KEY = "asdc" + "aa"; + private static final String PARTITION_KEY = "asdc" + "aa"; + + private final String SEND_NOTIFICATION = "send notification"; private Gson gson = new Gson(); public static boolean useHttpsWithDmaap = ConfigurationManager.getConfigurationManager().getDistributionEngineConfiguration().isUseHttpsWithDmaap(); - public static void main(String[] args) { - - // String userBodyJson ="{\"artifactName\":\"myartifact\", - // \"artifactType\":\"MURANO-PKG\", - // \"artifactDescription\":\"description\", - // \"payloadData\":\"UEsDBAoAAAAIAAeLb0bDQz\", \"Content-MD5\": - // \"YTg2Mjg4MWJhNmI5NzBiNzdDFkMWI=\" }"; - // System.out.println(userBodyJson); - // String encodeBase64Str = GeneralUtililty.calculateMD5 (userBodyJson); - // System.out.println(encodeBase64Str); - - CambriaTopicManager createTopicManager = null; - try { - List servers = new ArrayList(); - // servers.add("uebsb91kcdc.it.sdc.com:3904"); - // servers.add("uebsb92kcdc.it.sdc.com:3904"); - // servers.add("uebsb93kcdc.it.sdc.com:3904"); - servers.add("uebsb91sfdc.it.att.com:3904"); - servers.add("uebsb92sfdc.it.att.com:3904"); - - String key = "sSJc5qiBnKy2qrlc"; - String secret = "4ZRPzNJfEUK0sSNBvccd2m7X"; - - createTopicManager = buildCambriaClient(new TopicManagerBuilder().usingHosts(servers).authenticatedBy(key, secret)); - - String topicName = "ASDC-DISTR-NOTIF-TOPIC-PRODesofer"; - - String clientKey1 = "CGGoorrGPXPx2B1C"; - String clientSecret1 = "OTHk2mcCSbskEtHhDw8h5oUa"; - - CambriaTopicManager createStatusTopicManager = buildCambriaClient(new TopicManagerBuilder().usingHosts(servers).authenticatedBy(key, secret)); - String reportTopic = "ASDC-DISTR-STATUS-TOPIC-PRODESOFER"; - createStatusTopicManager.allowProducer(reportTopic, clientKey1); - - CambriaBatchingPublisher createSimplePublisher = new PublisherBuilder().onTopic(reportTopic).usingHttps(useHttpsWithDmaap).usingHosts(servers).build(); - createSimplePublisher.setApiCredentials(clientKey1, clientSecret1); - - DistributionStatusNotification distributionStatusNotification = new DistributionStatusNotification(); - distributionStatusNotification.setStatus(DistributionStatusNotificationEnum.DEPLOY_OK); - distributionStatusNotification.setArtifactURL("Ssssssss url"); - distributionStatusNotification.setDistributionID("idddddddddddddd"); - distributionStatusNotification.setTimestamp(System.currentTimeMillis()); - distributionStatusNotification.setConsumerID("my consumer id"); - - Gson gson = new Gson(); - int result = createSimplePublisher.send(PARTITION_KEY, gson.toJson(distributionStatusNotification)); - - List messagesInQ = createSimplePublisher.close(20, TimeUnit.SECONDS); - System.out.println(messagesInQ == null ? 0 : messagesInQ.size()); - - // createTopicManager.createTopic(topicName, "my test topic", 1, 1); - - /* - * - * { "secret": "OTHk2mcCSbskEtHhDw8h5oUa", "aux": { "email": "esofer@intl.sdc.com", "description": "test-keys" }, "key": "CGGoorrGPXPx2B1C" } - * - * - * { "secret": "FSlNJbmGWWBvBLJetQMYxPP6", "aux": { "email": "esofer@intl.sdc.com", "description": "test-keys" }, "key": "TAIEPO0aDU4VzM0G" } - * - */ - - String clientKey2 = "TAIEPO0aDU4VzM0G"; - - CambriaConsumer createConsumer1 = new ConsumerBuilder().authenticatedBy("asdc1", "consumerId1").onTopic(topicName).usingHttps(useHttpsWithDmaap).usingHosts(servers).build(); - createConsumer1.setApiCredentials(clientKey1, "OTHk2mcCSbskEtHhDw8h5oUa"); - - createTopicManager.allowConsumer(topicName, clientKey1); - - CambriaConsumer createConsumer2 = null; - if (true) { - createConsumer2 = new ConsumerBuilder().authenticatedBy("asdc2", "consumerId3").onTopic(topicName).usingHttps(useHttpsWithDmaap).usingHosts(servers).build(); - createConsumer2.setApiCredentials(clientKey2, "FSlNJbmGWWBvBLJetQMYxPP6"); - - createTopicManager.allowConsumer(topicName, clientKey2); - } - - createSimplePublisher = new PublisherBuilder().onTopic(topicName).usingHttps(useHttpsWithDmaap).usingHosts(servers).build(); - createSimplePublisher.setApiCredentials(key, secret); - createTopicManager.allowProducer(topicName, key); - - createSimplePublisher.send("aaaa", "{ my testttttttttttttttt }"); - - while (true) { - - Iterable fetch1 = createConsumer1.fetch(); - - Iterator iterator1 = fetch1.iterator(); - while (iterator1.hasNext()) { - System.out.println("***********************************************"); - System.out.println("client 1" + iterator1.next()); - System.out.println("***********************************************"); - } - - if (createConsumer2 != null) { - Iterable fetch2 = createConsumer2.fetch(); - - Iterator iterator2 = fetch2.iterator(); - while (iterator2.hasNext()) { - System.out.println("***********************************************"); - System.out.println("client 2" + iterator2.next()); - System.out.println("***********************************************"); - } - } - Thread.sleep(1000 * 20); - } - - // createTopicManager = CambriaClientFactory.createTopicManager( - // servers, "8F3MDAtMSBwwpSMy", "gzFmsTxSCtO5RQfAccM6PqqX"); - - // createTopicManager.deleteTopic("ASDC-DISTR-NOTIF-TOPIC-PROD"); - // createTopicManager.deleteTopic("ASDC-DISTR-NOTIF-TOPIC-PROD1"); - - // CambriaIdentityManager createIdentityManager = - // CambriaClientFactory.createIdentityManager(null, null, null); - // createIdentityManager.setApiCredentials(arg0, arg1); - // createIdentityManager.cl - - // String topicName = " "; - // createTopicManager.createTopic(topicName, - // "ASDC distribution notification topic", 1, 1); - // - // Thread.sleep(10 * 1000); - // - // for (int i = 0; i < 5; i++) { - // try { - // boolean openForProducing = createTopicManager - // .isOpenForProducing(topicName); - // - // System.out.println("openForProducing=" + openForProducing); - // createTopicManager.allowProducer(topicName, - // "8F3MDAtMSBwwpSMy"); - // Set allowedProducers = createTopicManager - // .getAllowedProducers(topicName); - // System.out.println(allowedProducers); - // - // } catch (Exception e) { - // e.printStackTrace(); - // } - // } - - // createTopicManager.createTopic("", "", 0, 0); - // createTopicManager.allowProducer(arg0, arg1); - // createTopicManager.getTopics(); - // createTopicManager.close(); - // CambriaClientFactory. - // CambriaBatchingPublisher createSimplePublisher = - // CambriaClientFactory.createSimplePublisher("hostlist", "topic"); - - // CambriaIdentityManager createIdentityManager = - // CambriaClientFactory.createIdentityManager(null, "apiKey", - // "apiSecret"); - // createIdentityManager. - - } catch (Exception e) { - Log.debug("Exception in main test of Cambria Handler: {}", e.getMessage(), e); - e.printStackTrace(); - } finally { - if (createTopicManager != null) { - createTopicManager.close(); - } - } - } /** * process the response error from Cambria client @@ -403,7 +246,8 @@ public class CambriaHandler { BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeUebSystemError, methodName, operationDesc); BeEcompErrorManager.getInstance().logBeUebSystemError(methodName, operationDesc); break; - + default: + break; } } @@ -661,7 +505,7 @@ public class CambriaHandler { CambriaErrorResponse cambriaErrorResponse = processError(e); - writeErrorToLog(cambriaErrorResponse, e.getMessage(), methodName, "send notification"); + writeErrorToLog(cambriaErrorResponse, e.getMessage(), methodName, SEND_NOTIFICATION); return cambriaErrorResponse; } finally { @@ -719,7 +563,7 @@ public class CambriaHandler { response = processError(e); - writeErrorToLog(response, e.getMessage(), methodName, "send notification"); + writeErrorToLog(response, e.getMessage(), methodName, SEND_NOTIFICATION); return response; @@ -733,7 +577,7 @@ public class CambriaHandler { response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500); String methodName = new Object() { }.getClass().getEnclosingMethod().getName(); - writeErrorToLog(response, "closing publisher returned non sent messages", methodName, "send notification"); + writeErrorToLog(response, "closing publisher returned non sent messages", methodName, SEND_NOTIFICATION); } else { logger.debug("No message left in the queue after closing cambria publisher"); response = new CambriaErrorResponse(CambriaOperationStatus.OK, 200); @@ -743,7 +587,7 @@ public class CambriaHandler { response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500); String methodName = new Object() { }.getClass().getEnclosingMethod().getName(); - writeErrorToLog(response, "closing publisher returned non sent messages", methodName, "send notification"); + writeErrorToLog(response, "closing publisher returned non sent messages", methodName, SEND_NOTIFICATION); } logger.debug("After closing publisher"); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java index d3d04ea735..bd3d74e323 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java @@ -34,7 +34,6 @@ import javax.annotation.PreDestroy; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.DistributionEngineConfiguration; -import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealth.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealth.java index 1b868951c5..85a868f156 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealth.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealth.java @@ -39,8 +39,8 @@ import javax.annotation.PreDestroy; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.DistributionEngineConfiguration; +import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; import org.openecomp.sdc.common.config.EcompErrorName; import org.slf4j.Logger; @@ -72,10 +72,10 @@ public class DistributionEngineClusterHealth { public enum HealthCheckInfoResult { - OK(new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.UP, null, ClusterStatusDescription.OK.getDescription())), - UNAVAILABLE(new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.UNAVAILABLE.getDescription())), - NOT_CONFIGURED(new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.NOT_CONFIGURED.getDescription())), - DISABLED(new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.DISABLED.getDescription())); + OK(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckStatus.UP, null, ClusterStatusDescription.OK.getDescription())), + UNAVAILABLE(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.UNAVAILABLE.getDescription())), + NOT_CONFIGURED(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.NOT_CONFIGURED.getDescription())), + DISABLED(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckStatus.DOWN, null, ClusterStatusDescription.DISABLED.getDescription())); private HealthCheckInfo healthCheckInfo; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/INotificationData.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/INotificationData.java index 48f6c42823..d631724701 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/INotificationData.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/INotificationData.java @@ -64,6 +64,8 @@ public interface INotificationData { /** List of the artifacts */ List getServiceArtifacts(); + String getWorkloadContext(); + void setDistributionID(String distributionId); /** Logical Service Name. */ @@ -99,4 +101,6 @@ public interface INotificationData { /** List of the Resource Instances */ void setServiceArtifacts(List artifacts); + void setWorkloadContext(String workloadContext); + } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/NotificationDataImpl.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/NotificationDataImpl.java index 149499811f..353039647d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/NotificationDataImpl.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/NotificationDataImpl.java @@ -32,6 +32,7 @@ public class NotificationDataImpl implements INotificationData { private String serviceInvariantUUID; private List resources; private List serviceArtifacts; + private String workloadContext; @Override public String getDistributionID() { @@ -76,12 +77,25 @@ public class NotificationDataImpl implements INotificationData { public void setServiceDescription(String serviceDescription) { this.serviceDescription = serviceDescription; } + @Override + public String getWorkloadContext() { return workloadContext; } + + @Override + public void setWorkloadContext(String workloadContext) { this.workloadContext = workloadContext; } - @Override public String toString() { - return "NotificationDataImpl [distributionID=" + distributionID + ", serviceName=" + serviceName + ", serviceVersion=" + serviceVersion + ", serviceUUID=" + serviceUUID + ", serviceDescription=" + serviceDescription - + ", serviceInvariantUUID=" + serviceInvariantUUID + ", resources=" + resources + ", serviceArtifacts=" + serviceArtifacts + "]"; + return "NotificationDataImpl{" + + "distributionID='" + distributionID + '\'' + + ", serviceName='" + serviceName + '\'' + + ", serviceVersion='" + serviceVersion + '\'' + + ", serviceUUID='" + serviceUUID + '\'' + + ", serviceDescription='" + serviceDescription + '\'' + + ", serviceInvariantUUID='" + serviceInvariantUUID + '\'' + + ", resources=" + resources + + ", serviceArtifacts=" + serviceArtifacts + + ", workloadContext='" + workloadContext + '\'' + + '}'; } @Override diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilder.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilder.java index 90120288bc..0330a756c6 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilder.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/ServiceDistributionArtifactsBuilder.java @@ -101,7 +101,10 @@ public class ServiceDistributionArtifactsBuilder { notificationData.setServiceUUID(service.getUUID()); notificationData.setServiceDescription(service.getDescription()); notificationData.setServiceInvariantUUID(service.getInvariantUUID()); - + String workloadContext= ConfigurationManager.getConfigurationManager().getConfiguration().getWorkloadContext(); + if(workloadContext!=null){ + notificationData.setWorkloadContext(workloadContext); + } logger.debug("Before returning notification data object {}", notificationData); return notificationData; @@ -198,7 +201,7 @@ public class ServiceDistributionArtifactsBuilder { } JsonContainerResourceInstance jsonContainer = new JsonContainerResourceInstance(resourceInstance, resoucreType, - artifacts); + rebuildArtifactswith120TimeoutInsteadOf60(artifacts)/*TODO used to send artifacts, the function is a fix to the short timeout bug in distribution*/); jsonContainer.setResourceInvariantUUID(resourceInvariantUUID); jsonContainer.setCategory(resourceCategory); jsonContainer.setSubcategory(resourceSubcategory); @@ -208,6 +211,15 @@ public class ServiceDistributionArtifactsBuilder { return ret; } + private List rebuildArtifactswith120TimeoutInsteadOf60(List artifacts) { + for(ArtifactInfoImpl artifact : artifacts){ + if(artifact.getArtifactTimeout().equals(60)){ + artifact.setArtifactTimeout(120); + } + } + return artifacts; + } + private List getArtifactsWithPayload(ComponentInstance resourceInstance) { List ret = new ArrayList(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayload.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayload.java index 2bcaa4f54a..d706e40f5c 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayload.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayload.java @@ -20,13 +20,11 @@ package org.openecomp.sdc.be.components.distribution.engine; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import org.apache.commons.collections.CollectionUtils; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupInstance; import org.openecomp.sdc.be.model.GroupInstanceProperty; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactResolverImpl.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactResolverImpl.java index 141ed95575..1c5a35453b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactResolverImpl.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactResolverImpl.java @@ -20,13 +20,6 @@ package org.openecomp.sdc.be.components.impl; -import org.openecomp.sdc.be.components.ArtifactsResolver; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.Service; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -34,6 +27,13 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import org.openecomp.sdc.be.components.ArtifactsResolver; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Service; + @org.springframework.stereotype.Component("artifact-resolver") public class ArtifactResolverImpl implements ArtifactsResolver { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index b7344e9911..bd7f61444d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -63,6 +63,7 @@ import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.info.ArtifactTemplateInfo; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.ArtifactType; import org.openecomp.sdc.be.model.Component; @@ -111,12 +112,19 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.xml.sax.*; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.XMLReader; import org.yaml.snakeyaml.Yaml; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.sun.org.apache.xerces.internal.parsers.SAXParser; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; import fj.data.Either; @@ -142,7 +150,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { // private static final Integer NON_HEAT_TIMEOUT = 0; private static Logger log = LoggerFactory.getLogger(ArtifactsBusinessLogic.class.getName()); private Gson gson = new GsonBuilder().setPrettyPrinting().create(); - + private static XMLReader parser; @javax.annotation.Resource private IInterfaceLifecycleOperation interfaceLifecycleOperation; @javax.annotation.Resource @@ -198,7 +206,30 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } + + //SAX XML Parser initialization + static { + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser newSAXParser = null; + + try { + newSAXParser = spf.newSAXParser(); + parser = newSAXParser.getXMLReader(); + } catch (ParserConfigurationException | SAXException e1) { + log.debug("SAX XML Parser could not been initialized", e1); + } + + try { + parser.setFeature("http://apache.org/xml/features/validation/schema", false); + } catch (SAXNotRecognizedException e) { + log.debug("SAX Xml parser couldn't set feature: \"http://apache.org/xml/features/validation/schema\", false", e.getMessage(), e); + + } catch (SAXNotSupportedException e) { + log.debug("SAX Xml parser couldn't set feature: \"http://apache.org/xml/features/validation/schema\", false", e.getMessage(), e); + } + } + public class ArtifactOperationInfo { private ArtifactOperationEnum artifactOperationEnum; @@ -438,8 +469,10 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } return result; - case Create: - return handleCreate(componentId, artifactInfo, operation, auditingAction, user, componentType, parent, origMd5, originData, interfaceName, operationName, shouldLock, inTransaction); + case Create: + return handleCreate(componentId, artifactInfo, operation, auditingAction, user, componentType, parent, origMd5, originData, interfaceName, operationName, shouldLock, inTransaction); + case Link: + return handleLink(componentId, artifactInfo, operation, auditingAction, user, componentType, parent, origMd5, originData, interfaceName, operationName, shouldLock, inTransaction); } return null; } @@ -603,16 +636,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } - /** - * - * @param componentId - * @param artifactId - * @param userId - * @param componentType - * @param parentId - * @return - */ - public Either, ResponseFormat> handleDownloadToscaModelRequest(Component component, ArtifactDefinition csarArtifact) { if (artifactGenerationRequired(component, csarArtifact)) { Either generated = csarUtils.createCsar(component, false, false); @@ -839,6 +862,30 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } + private Either, ResponseFormat> handleLink(String componentId, ArtifactDefinition artifactInfo, ArtifactOperationInfo operation, AuditingActionEnum auditingAction, User user, ComponentTypeEnum componentType, + org.openecomp.sdc.be.model.Component parent, String origMd5, String originData, String interfaceType, String operationName, boolean shouldLock, boolean inTransaction) { + + if (shouldLock) { + Either lockComponent = lockComponent(parent, "Upload Artifact - lock "); + if (lockComponent.isRight()) { + handleAuditing(auditingAction, parent, componentId, user, null, null, null, lockComponent.right().value(), componentType, null); + return Either.right(lockComponent.right().value()); + } + } + Either, ResponseFormat> resultOp = null; + + try { + resultOp = createAndLinkArtifact(parent, componentId, artifactInfo, user, componentType, auditingAction); + return resultOp; + } finally { + if (shouldLock) { + unlockComponent(resultOp, parent, inTransaction); + } + + } + + } + private Either, ResponseFormat> lockComponentAndUpdateArtifact(String parentId, ArtifactDefinition artifactInfo, AuditingActionEnum auditingAction, String artifactId, User user, ComponentTypeEnum componentType, org.openecomp.sdc.be.model.Component parent, byte[] decodedPayload, String interfaceType, String operationName, boolean shouldLock, boolean inTransaction) { @@ -920,9 +967,9 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { public void handleAuditing(AuditingActionEnum auditingActionEnum, Component component, String componentId, User user, ArtifactDefinition artifactDefinition, String prevArtifactUuid, String currentArtifactUuid, ResponseFormat responseFormat, ComponentTypeEnum componentTypeEnum, String resourceInstanceName) { - if (auditingActionEnum.getAuditingEsType().equals(AuditingTypesConstants.EXTERNAL_API_EVENT_TYPE)) { + if (auditingActionEnum != null && auditingActionEnum.getAuditingEsType().equals(AuditingTypesConstants.EXTERNAL_API_EVENT_TYPE)) { return; - } + } EnumMap auditingFields = createArtifactAuditingFields(artifactDefinition, prevArtifactUuid, currentArtifactUuid); @@ -1019,9 +1066,11 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_INVALID_MD5)); } } else { - if (operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create) { - log.debug("Missing md5 header during artifact create"); - return Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_INVALID_MD5)); + if (ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { + if (payload!=null && payload.length != 0) { + log.debug("Missing md5 header during artifact create"); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_INVALID_MD5)); + } } // Update metadata if (payload != null && payload.length != 0) { @@ -1061,7 +1110,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { // This is a patch to block possibility of updating service api fields // through other artifacts flow - if (operation.getArtifactOperationEnum() != ArtifactOperationEnum.Create) { + if (!ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { checkAndSetUnUpdatableFields(user, artifactInfo, currentArtifactInfo, (operationName != null ? ArtifactGroupTypeEnum.LIFE_CYCLE : ArtifactGroupTypeEnum.INFORMATIONAL)); } else { checkCreateFields(user, artifactInfo, (operationName != null ? ArtifactGroupTypeEnum.LIFE_CYCLE : ArtifactGroupTypeEnum.INFORMATIONAL)); @@ -1073,7 +1122,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } // artifactGroupType is not allowed to be updated - if (operation.getArtifactOperationEnum() != ArtifactOperationEnum.Create) { + if (!ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { Either validateGroupType = validateOrSetArtifactGroupType(artifactInfo, currentArtifactInfo); if (validateGroupType.isRight()) { return Either.right(validateGroupType.right().value()); @@ -1083,7 +1132,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { NodeTypeEnum parentType = convertParentType(componentType); // TODO TEMP !!! - boolean isCreate = operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create; + boolean isCreate = ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum()); if (isDeploymentArtifact(artifactInfo)) { Either deploymentValidationResult = validateDeploymentArtifact(parentComponent, componentId, user.getUserId(), isCreate, artifactInfo, currentArtifactInfo, parentType); @@ -1159,11 +1208,11 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { if (StringUtils.isNotEmpty(artifactId)) { foundArtifact = findArtifact(parentComponent, componentType, parentId, artifactId); } - if (foundArtifact != null && operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create) { + if (foundArtifact != null && ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { log.debug("Artifact {} already exist", artifactId); result = Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_EXIST, foundArtifact.getArtifactLabel())); } - if (foundArtifact == null && operation.getArtifactOperationEnum() != ArtifactOperationEnum.Create) { + if (foundArtifact == null && !ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { log.debug("The artifact {} was not found on parent {}. ", artifactId, parentId); result = Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, "")); } @@ -1272,7 +1321,22 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { resultOp = Either.right(responseFormat); } } + boolean isNeedToDeleteArtifactFromDB = true; if (resultOp == null) { + + if(componentType == ComponentTypeEnum.RESOURCE_INSTANCE){ + String instanceId = parentId; + Either isOnlyResourceInstanceArtifact = isArtifactOnlyResourceInstanceArtifact(foundArtifact, fetchedContainerComponent, instanceId); + + if (isOnlyResourceInstanceArtifact.isRight()) { + log.debug("Failed to delete or update the artifact {}. Parent uniqueId is {}", artifactId, parentId); + responseFormat = componentsUtils.getResponseFormatByArtifactId(isOnlyResourceInstanceArtifact.right().value(), foundArtifact.getArtifactDisplayName()); + handleAuditing(auditingAction, parent, parentId, user, null, null, artifactId, responseFormat, componentType, null); + resultOp = Either.right(responseFormat); + } + isNeedToDeleteArtifactFromDB = isOnlyResourceInstanceArtifact.left().value(); + } + Either updatedArtifactRes = deleteOrUpdateArtifactOnGraph(parent, parentId, artifactId, parentType, foundArtifact, needCloneRes.left().value()); if (updatedArtifactRes.isRight()) { log.debug("Failed to delete or update the artifact {}. Parent uniqueId is {}", artifactId, parentId); @@ -1285,13 +1349,16 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } if (resultOp == null && (!needCloneRes.left().value() && !isDuplicated)) { - log.debug("Going to delete the artifact {} from the database. ", artifactId); - CassandraOperationStatus cassandraStatus = artifactCassandraDao.deleteArtifact(esId); - if (cassandraStatus != CassandraOperationStatus.OK) { - log.debug("Failed to delete the artifact {} from the database. ", artifactId); - responseFormat = componentsUtils.getResponseFormatByArtifactId(componentsUtils.convertFromStorageResponse(convertToStorageOperationStatus(cassandraStatus)), foundArtifact.getArtifactDisplayName()); - handleAuditing(auditingAction, parent, parentId, user, null, null, artifactId, responseFormat, componentType, null); - resultOp = Either.right(responseFormat); + + if(isNeedToDeleteArtifactFromDB){ + log.debug("Going to delete the artifact {} from the database. ", artifactId); + CassandraOperationStatus cassandraStatus = artifactCassandraDao.deleteArtifact(esId); + if (cassandraStatus != CassandraOperationStatus.OK) { + log.debug("Failed to delete the artifact {} from the database. ", artifactId); + responseFormat = componentsUtils.getResponseFormatByArtifactId(componentsUtils.convertFromStorageResponse(convertToStorageOperationStatus(cassandraStatus)), foundArtifact.getArtifactDisplayName()); + handleAuditing(auditingAction, parent, parentId, user, null, null, artifactId, responseFormat, componentType, null); + resultOp = Either.right(responseFormat); + } } } if (resultOp == null && componentType == ComponentTypeEnum.RESOURCE_INSTANCE) { @@ -1340,6 +1407,40 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } + private Either isArtifactOnlyResourceInstanceArtifact( ArtifactDefinition foundArtifact, Component parent, String instanceId) { + Either result = Either.left(true); + ComponentInstance foundInstance = null; + Optional componentInstanceOpt = parent.getComponentInstances().stream().filter(i -> i.getUniqueId().equals(instanceId)).findFirst(); + if (!componentInstanceOpt.isPresent()) { + result = Either.right(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER); + } else { + foundInstance = componentInstanceOpt.get(); + String componentUid = foundInstance.getComponentUid(); + Either getContainerRes = toscaOperationFacade.getToscaElement(parent.getUniqueId()); + if (getContainerRes.isRight()) { + log.debug("Failed to fetch the container component {}. ", componentUid); + result = Either.right(componentsUtils.convertFromStorageResponse(getContainerRes.right().value())); + } + Component origComponent = getContainerRes.left().value(); + Map deploymentArtifacts = origComponent.getDeploymentArtifacts(); + if( deploymentArtifacts!= null && !deploymentArtifacts.isEmpty()){ + Optional op = deploymentArtifacts.keySet().stream().filter(a -> a.equals(foundArtifact.getArtifactLabel())).findAny(); + if(op.isPresent()){ + return Either.left(false); + } + } + Map artifacts = origComponent.getArtifacts(); + if( artifacts!= null && !artifacts.isEmpty()){ + Optional op = artifacts.keySet().stream().filter(a -> a.equals(foundArtifact.getArtifactLabel())).findAny(); + if(op.isPresent()){ + return Either.left(false); + } + } + + } + return result; + } + private List getUpdatedGroups(String artifactId, ArtifactDefinition foundArtifact, List groups) { List updatedGroups = new ArrayList<>(); boolean isUpdated = false; @@ -1393,7 +1494,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { if (isMandatory) { log.debug("Going to update mandatory artifact {} from the component {}", artifactId, parentId); resetMandatoryArtifactFields(foundArtifact); - result = artifactToscaOperation.updateArtifactOnGraph(componentId, foundArtifact, parentType, artifactId, instanceId, true); + result = artifactToscaOperation.updateArtifactOnGraph(componentId, foundArtifact, parentType, artifactId, instanceId, true, true); } else if (cloneIsNeeded) { log.debug("Going to clone artifacts and to delete the artifact {} from the component {}", artifactId, parentId); result = artifactToscaOperation.deleteArtifactWithClonnigOnGraph(componentId, foundArtifact, parentType, instanceId, false); @@ -1540,13 +1641,13 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { private Either fetchCurrentArtifact(String parentId, ArtifactOperationInfo operation, String artifactId) { Either artifactById = artifactToscaOperation.getArtifactById(parentId, artifactId); - if (!(operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create) && artifactById.isRight()) { + if (!(ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) && artifactById.isRight()) { // in case of update artifact must be BeEcompErrorManager.getInstance().logBeArtifactMissingError("Artifact Update / Upload", artifactId); log.debug("Failed to fetch artifact {}. error: {}", artifactId, artifactById.right().value()); return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(artifactById.right().value()), artifactId)); } - if (operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create && artifactById.isLeft()) { + if (ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum()) && artifactById.isLeft()) { log.debug("Artifact {} already exist", artifactId); return Either.right(componentsUtils.getResponseFormat(ActionStatus.ARTIFACT_EXIST, artifactById.left().value().getArtifactLabel())); } @@ -1567,7 +1668,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { log.debug("missing artifact logical name for component {}", componentId); return Either.right(componentsUtils.getResponseFormat(ActionStatus.MISSING_DATA, ARTIFACT_LABEL)); } - if (operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create && !artifactInfo.getMandatory()) { + if (ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum()) && !artifactInfo.getMandatory()) { if (operationName != null) { if (artifactInfo.getArtifactLabel() != null && !operationName.equals(artifactInfo.getArtifactLabel())) { @@ -1647,6 +1748,52 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { // *************************************************************** + private Either, ResponseFormat> createAndLinkArtifact(org.openecomp.sdc.be.model.Component parent, String parentId, ArtifactDefinition artifactInfo, User user, + ComponentTypeEnum componentTypeEnum, AuditingActionEnum auditingActionEnum) { + Either, ResponseFormat> resultOp = null; + Either insideEither = null; + ComponentInstance foundInstance = findComponentInstance(parentId, parent); + String instanceId = null; + String instanceName = null; + if (foundInstance != null) { + instanceId = foundInstance.getUniqueId(); + instanceName = foundInstance.getName(); + } + boolean isLeft = false; + String artifactUniqueId = null; + StorageOperationStatus error = null; + // information/deployment/api aritfacts + log.trace("Try to create entry on graph"); + NodeTypeEnum nodeType = convertParentType(componentTypeEnum); + Either result = artifactToscaOperation.addArifactToComponent(artifactInfo, parent.getUniqueId(), nodeType, true, instanceId); + + isLeft = result.isLeft(); + if (isLeft) { + artifactUniqueId = result.left().value().getUniqueId(); + result.left().value(); + + insideEither = Either.left(result.left().value()); + resultOp = Either.left(insideEither); + + error = generateCustomizationUUIDOnInstance(parent.getUniqueId(), parentId, componentTypeEnum); + if (error != StorageOperationStatus.OK) { + isLeft = false; + } + + } if (isLeft) { + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.OK); + handleAuditing(auditingActionEnum, parent, parentId, user, artifactInfo, artifactUniqueId, artifactUniqueId, responseFormat, componentTypeEnum, instanceName); + return resultOp; + } else{ + log.debug("Failed to create entry on graph for artifact {}", artifactInfo.getArtifactName()); + ResponseFormat responseFormat = componentsUtils.getResponseFormatByArtifactId(componentsUtils.convertFromStorageResponse(error), artifactInfo.getArtifactDisplayName()); + handleAuditing(auditingActionEnum, parent, parentId, user, artifactInfo, null, null, responseFormat, componentTypeEnum, instanceName); + resultOp = Either.right(responseFormat); + return resultOp; + + } + } + private Either, ResponseFormat> createArtifact(org.openecomp.sdc.be.model.Component parent, String parentId, ArtifactDefinition artifactInfo, byte[] decodedPayload, User user, ComponentTypeEnum componentTypeEnum, AuditingActionEnum auditingActionEnum, String interfaceType, String operationName) { @@ -2039,27 +2186,20 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } - @SuppressWarnings("restriction") public boolean isValidXml(byte[] xmlToParse) { - XMLReader parser = new SAXParser(); - try { - parser.setFeature("http://apache.org/xml/features/validation/schema", false); - } catch (SAXNotRecognizedException e) { - e.printStackTrace(); - log.debug("Xml parser couldn't set feature: \"http://apache.org/xml/features/validation/schema\", false", e.getMessage(), e); - - } catch (SAXNotSupportedException e) { - e.printStackTrace(); - log.debug("Xml parser couldn't set feature: \"http://apache.org/xml/features/validation/schema\", false", e.getMessage(), e); - + if(parser == null) { + log.debug("SAX XML Parser have not been initialized"); + return false; } boolean isXmlValid = true; + try { parser.parse(new InputSource(new ByteArrayInputStream(xmlToParse))); } catch (IOException | SAXException e) { log.debug("Xml is invalid : {}", e.getMessage(), e); isXmlValid = false; } + return isXmlValid; } @@ -2898,22 +3038,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } - public StorageOperationStatus deleteAllComponentArtifactsIfNotOnGraph(List artifacts) { - - if (artifacts != null && !artifacts.isEmpty()) { - for (ArtifactDefinition artifactDefinition : artifacts) { - String esId = artifactDefinition.getEsId(); - if (esId != null && !esId.isEmpty()) { - StorageOperationStatus deleteIfNotOnGraph = deleteIfNotOnGraph(artifactDefinition.getUniqueId(), esId, false); - if (!deleteIfNotOnGraph.equals(StorageOperationStatus.OK)) { - return deleteIfNotOnGraph; - } - } - } - } - return StorageOperationStatus.OK; - } - private Operation convertToOperation(ArtifactDefinition artifactInfo, String operationName) { Operation op = new Operation(); long time = System.currentTimeMillis(); @@ -2933,31 +3057,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return newArtifactName; } - public StorageOperationStatus deleteIfNotOnGraph(String artifactId, String artifactEsId, boolean deleteOnlyPayload) { - log.debug("deleteIfNotOnGraph: delete only payload = {}", deleteOnlyPayload); - // Either checkArtifactNode = titanDao.getNode(UniqueIdBuilder.getKeyByNodeType(NodeTypeEnum.ArtifactRef), artifactId, ArtifactData.class); - // if ((artifactEsId != null && !artifactEsId.isEmpty())) { - // boolean isNotExistOnGraph = checkArtifactNode.isRight() && checkArtifactNode.right().value().equals(TitanOperationStatus.NOT_FOUND); - // - // if ((isNotExistOnGraph) || (checkArtifactNode.left().value().getArtifactDataDefinition().getMandatory() && deleteOnlyPayload) - // || (ArtifactGroupTypeEnum.SERVICE_API.equals(checkArtifactNode.left().value().getArtifactDataDefinition().getArtifactGroupType()) && deleteOnlyPayload)) { - // // last one. need to delete in ES - // log.debug("Entry on graph is deleted. Delete artifact in ES for id = {}", artifactEsId); - // artifactCassandraDao.deleteArtifact(artifactEsId); - // return StorageOperationStatus.OK; - // // return - // // componentsUtils.getResponseFormatByResourceId(ActionStatus.OK, - // // resourceId); - // - // } else { - // log.debug("Entry on graph is deleted. Exist more connections on this artifact. Don't delete artifact in ES for id = {}", artifactEsId); - // return StorageOperationStatus.OK; - // } - // - // } - return StorageOperationStatus.OK; - } - // download by MSO public Either downloadRsrcArtifactByNames(String serviceName, String serviceVersion, String resourceName, String resourceVersion, String artifactName) { @@ -3512,35 +3611,46 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { String payload = generateHeatEnvPayload(artifactDefinition); String prevUUID = artifactDefinition.getArtifactUUID(); ArtifactDefinition clonedBeforeGenerate = new ArtifactDefinition(artifactDefinition); - Either generateResult = generateAndSaveHeatEnvArtifact(artifactDefinition, payload, componentType, component, resourceInstanceName, modifier, shouldLock, instanceId); - if (generateResult.isLeft()) { - ArtifactDefinition updatedArtDef = generateResult.left().value(); - if (!prevUUID.equals(updatedArtDef.getArtifactUUID())) { - List componentInstances = component.getComponentInstances(); - if (componentInstances != null) { - Optional findFirst = componentInstances.stream().filter(ci -> ci.getUniqueId().equals(instanceId)).findFirst(); - if (findFirst.isPresent()) { - ComponentInstance relevantInst = findFirst.get(); - List updatedGroupInstances = getUpdatedGroupInstances(updatedArtDef.getUniqueId(), clonedBeforeGenerate, relevantInst.getGroupInstances()); - - if (CollectionUtils.isNotEmpty(updatedGroupInstances)) { - updatedGroupInstances.forEach(gi -> { - gi.getGroupInstanceArtifacts().add(updatedArtDef.getUniqueId()); - gi.getGroupInstanceArtifactsUuid().add(updatedArtDef.getArtifactUUID()); - }); - Either, StorageOperationStatus> status = toscaOperationFacade.updateGroupInstancesOnComponent(component, componentType, instanceId, updatedGroupInstances); - if (status.isRight()) { - log.debug("Failed to update groups of the component {}. ", component.getUniqueId()); - ResponseFormat responseFormat = componentsUtils.getResponseFormatByArtifactId(componentsUtils.convertFromStorageResponse(status.right().value()), clonedBeforeGenerate.getArtifactDisplayName()); - return Either.right(responseFormat); - } - } - } - } - } - } + return generateAndSaveHeatEnvArtifact(artifactDefinition, payload, componentType, component, resourceInstanceName, modifier, shouldLock, instanceId) + .left() + .bind(artifactDef -> updateArtifactOnGroupInstance(componentType, component, instanceId, prevUUID, clonedBeforeGenerate, artifactDef)); + } - return generateResult; + public Either forceGenerateHeatEnvArtifact(ArtifactDefinition artifactDefinition, ComponentTypeEnum componentType, org.openecomp.sdc.be.model.Component component, String resourceInstanceName, User modifier, + boolean shouldLock, String instanceId) { + String payload = generateHeatEnvPayload(artifactDefinition); + String prevUUID = artifactDefinition.getArtifactUUID(); + ArtifactDefinition clonedBeforeGenerate = new ArtifactDefinition(artifactDefinition); + return forceGenerateAndSaveHeatEnvArtifact(artifactDefinition, payload, componentType, component, resourceInstanceName, modifier, shouldLock, instanceId) + .left() + .bind(artifactDef -> updateArtifactOnGroupInstance(componentType, component, instanceId, prevUUID, clonedBeforeGenerate, artifactDef)); + } + + private Either updateArtifactOnGroupInstance(ComponentTypeEnum componentType, Component component, String instanceId, String prevUUID, ArtifactDefinition clonedBeforeGenerate, ArtifactDefinition updatedArtDef) { + if (!prevUUID.equals(updatedArtDef.getArtifactUUID())) { + List componentInstances = component.getComponentInstances(); + if (componentInstances != null) { + Optional findFirst = componentInstances.stream().filter(ci -> ci.getUniqueId().equals(instanceId)).findFirst(); + if (findFirst.isPresent()) { + ComponentInstance relevantInst = findFirst.get(); + List updatedGroupInstances = getUpdatedGroupInstances(updatedArtDef.getUniqueId(), clonedBeforeGenerate, relevantInst.getGroupInstances()); + + if (CollectionUtils.isNotEmpty(updatedGroupInstances)) { + updatedGroupInstances.forEach(gi -> { + gi.getGroupInstanceArtifacts().add(updatedArtDef.getUniqueId()); + gi.getGroupInstanceArtifactsUuid().add(updatedArtDef.getArtifactUUID()); + }); + Either, StorageOperationStatus> status = toscaOperationFacade.updateGroupInstancesOnComponent(component, componentType, instanceId, updatedGroupInstances); + if (status.isRight()) { + log.debug("Failed to update groups of the component {}. ", component.getUniqueId()); + ResponseFormat responseFormat = componentsUtils.getResponseFormatByArtifactId(componentsUtils.convertFromStorageResponse(status.right().value()), clonedBeforeGenerate.getArtifactDisplayName()); + return Either.right(responseFormat); + } + } + } + } + } + return Either.left(updatedArtDef); } private String generateHeatEnvPayload(ArtifactDefinition artifactDefinition) { @@ -3628,6 +3738,13 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } + public Either forceGenerateAndSaveHeatEnvArtifact(ArtifactDefinition artifactDefinition, String payload, ComponentTypeEnum componentType, org.openecomp.sdc.be.model.Component component, String resourceInstanceName, + User modifier, boolean shouldLock, String instanceId) { + return generateArtifactPayload(artifactDefinition, componentType, component, resourceInstanceName, modifier, shouldLock, System::currentTimeMillis, + () -> createEsHeatEnvArtifactDataFromString(artifactDefinition, payload), instanceId); + + } + protected Either generateArtifactPayload(ArtifactDefinition artifactDefinition, ComponentTypeEnum componentType, org.openecomp.sdc.be.model.Component component, String resourceInstanceName, User modifier, boolean shouldLock, Supplier payloadUpdateDateGen, Supplier> esDataCreator, String instanceId) { @@ -3743,6 +3860,57 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.left(artifactDefinition); } + + public Map buildJsonForUpdateArtifact(ArtifactDefinition artifactDef, ArtifactGroupTypeEnum artifactGroupType, List updatedRequiredArtifacts) { + return this.buildJsonForUpdateArtifact(artifactDef.getUniqueId(), artifactDef.getArtifactName(), artifactDef.getArtifactType(), artifactGroupType, artifactDef.getArtifactLabel(), artifactDef.getArtifactDisplayName(), + artifactDef.getDescription(), artifactDef.getPayloadData(), updatedRequiredArtifacts, artifactDef.getListHeatParameters()); + + } + + public Map buildJsonForUpdateArtifact(String artifactId, String artifactName, String artifactType, ArtifactGroupTypeEnum artifactGroupType, String label, String displayName, String description, byte[] artifactContent, + List updatedRequiredArtifacts, List heatParameters) { + + Map json = new HashMap(); + if (artifactId != null && !artifactId.isEmpty()) + json.put(Constants.ARTIFACT_ID, artifactId); + + json.put(Constants.ARTIFACT_NAME, artifactName); + json.put(Constants.ARTIFACT_TYPE, artifactType); + json.put(Constants.ARTIFACT_DESCRIPTION, description); + + if (artifactContent != null) { + String encodedPayload = new String(artifactContent); + + // boolean isEncoded = GeneralUtility.isBase64Encoded(artifactContentent); + // if (!isEncoded) { + log.debug("payload is encoded. perform decode"); + encodedPayload = Base64.encodeBase64String(artifactContent); + json.put(Constants.ARTIFACT_PAYLOAD_DATA, encodedPayload); + } + // } + json.put(Constants.ARTIFACT_DISPLAY_NAME, displayName); + json.put(Constants.ARTIFACT_LABEL, label); + json.put(Constants.ARTIFACT_GROUP_TYPE, artifactGroupType.getType()); + json.put(Constants.REQUIRED_ARTIFACTS, (updatedRequiredArtifacts == null || updatedRequiredArtifacts.isEmpty()) ? new ArrayList<>() + : updatedRequiredArtifacts.stream().filter(e -> e.getType().equals(ArtifactTypeEnum.HEAT_ARTIFACT.getType()) || e.getType().equals(ArtifactTypeEnum.HEAT_NESTED.getType())).map(e -> e.getFileName()).collect(Collectors.toList())); + json.put(Constants.ARTIFACT_HEAT_PARAMS, (heatParameters == null || heatParameters.isEmpty()) ? new ArrayList<>() + : heatParameters); + return json; + } + + public Either, ResponseFormat> updateResourceInstanceArtifactNoContent(String resourceId, Component containerComponent, User user, Map json, ArtifactOperationInfo operation, ArtifactDefinition artifactInfo) { + + String jsonStr = gson.toJson(json); + ArtifactDefinition artifactDefinitionFromJson = artifactInfo == null? RepresentationUtils.convertJsonToArtifactDefinition(jsonStr, ArtifactDefinition.class) : artifactInfo; + String artifactUniqueId = artifactDefinitionFromJson == null ? null : artifactDefinitionFromJson.getUniqueId(); + Either, ResponseFormat> uploadArtifactToService = validateAndHandleArtifact(resourceId, ComponentTypeEnum.RESOURCE_INSTANCE, operation, artifactUniqueId, + artifactDefinitionFromJson, null, jsonStr, null, null, null, user, containerComponent, false, false, true); + if (uploadArtifactToService.isRight()) + return Either.right(uploadArtifactToService.right().value()); + + return Either.left(uploadArtifactToService.left().value()); + } + private Either, ResponseFormat> handleUpdateHeatEnv(String componentId, ArtifactDefinition artifactInfo, AuditingActionEnum auditingAction, String artifactId, User user, ComponentTypeEnum componentType, org.openecomp.sdc.be.model.Component parent, String originData, String origMd5, ArtifactOperationInfo operation, boolean shouldLock, boolean inTransaction) { convertParentType(componentType); @@ -3789,7 +3957,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } Either, ResponseFormat> resultOp = null; try { - resultOp = updateHeatEnvParams(componentId, artifactId, artifactInfo, user, auditingAction, parent, componentType, currArtifact, origMd5, inTransaction); + resultOp = updateHeatEnvParams(componentId, artifactId, artifactInfo, user, auditingAction, parent, componentType, origMd5); return resultOp; } finally { @@ -3812,7 +3980,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } private Either, ResponseFormat> updateHeatEnvParams(String componentId, String artifactId, ArtifactDefinition artifactInfo, User user, AuditingActionEnum auditingAction, Component parent, - ComponentTypeEnum componentType, ArtifactDefinition currArtifact1, String origMd5, boolean inTransaction) { + ComponentTypeEnum componentType, String origMd5) { Either, ResponseFormat> resultOp = null; Either insideEither = null; @@ -3859,22 +4027,9 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } if (updatedHeatEnvParams != null && !updatedHeatEnvParams.isEmpty()) { - String paramName; // fill reduced heat env parameters List for updating - for (HeatParameterDefinition heatEnvParam : updatedHeatEnvParams) { - paramName = heatEnvParam.getName(); - for (HeatParameterDefinition currHeatParam : currentHeatEnvParams) { - if (paramName.equalsIgnoreCase(currHeatParam.getName())) { - String updatedParamValue = heatEnvParam.getCurrentValue(); - if (updatedParamValue != null && updatedParamValue.equals("")) { // reset - currHeatParam.setCurrentValue(heatEnvParam.getDefaultValue()); - } else if (updatedParamValue != null) { - currHeatParam.setCurrentValue(updatedParamValue); - } - } - } - } - //currArtifact.setHeatParamsUpdateDate(System.currentTimeMillis()); + replaceCurrHeatValueWithUpdatedValue(currentHeatEnvParams, updatedHeatEnvParams); + currArtifact.setHeatParamsUpdateDate(System.currentTimeMillis()); currArtifact.setListHeatParameters(currentHeatEnvParams); Either updateArifactRes = artifactToscaOperation.updateArifactOnResource(currArtifact, parent.getUniqueId(), currArtifact.getUniqueId(), componentType.getNodeType(), componentId); @@ -3899,8 +4054,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } } - // } - insideEither = Either.left(currArtifact); resultOp = Either.left(insideEither); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.OK); @@ -3908,6 +4061,18 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return resultOp; } + private void replaceCurrHeatValueWithUpdatedValue(List currentHeatEnvParams, List updatedHeatEnvParams) { + for (HeatParameterDefinition heatEnvParam : updatedHeatEnvParams) { + String paramName = heatEnvParam.getName(); + for (HeatParameterDefinition currHeatParam : currentHeatEnvParams) { + if (paramName.equalsIgnoreCase(currHeatParam.getName())) { + String updatedParamValue = heatEnvParam.getCurrentValue(); + currHeatParam.setCurrentValue(updatedParamValue); + } + } + } + } + private Either, ResponseFormat> updateHeatParams(String componentId, String artifactId, ArtifactDefinition artifactEnvInfo, User user, AuditingActionEnum auditingAction, Component parent, ComponentTypeEnum componentType, ArtifactDefinition currHeatArtifact, String origMd5, boolean needToUpdateGroup) { @@ -3929,9 +4094,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } ESArtifactData esArtifactData = artifactfromES.left().value(); - byte[] data = esArtifactData.getDataAsArray(); - - ArtifactDefinition updatedHeatArt = currHeatArtifact; List updatedHeatEnvParams = artifactEnvInfo.getListHeatParameters(); @@ -4149,7 +4311,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { * * @param componentType * @param componentUuid - * @param resourceName + * @param resourceInstanceName * @param artifactUUID * @param auditAdditionalParam * @return @@ -4574,15 +4736,9 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return artifactId; } - public Either createHeatEnvPlaceHolder(ArtifactDefinition artifact, String envType, String parentId, NodeTypeEnum parentType, String parentName, User user, Component component, - Map existingEnvVersions) { - return createHeatEnvPlaceHolder(artifact, envType, parentId, parentType, parentName, user, component, existingEnvVersions, true); - - } - @SuppressWarnings("unchecked") - public Either createHeatEnvPlaceHolder(ArtifactDefinition artifact, String envType, String parentId, NodeTypeEnum parentType, String parentName, User user, Component component, - Map existingEnvVersions, boolean overrideId) { + public Either createHeatEnvPlaceHolder(ArtifactDefinition heatArtifact, String envType, String parentId, NodeTypeEnum parentType, String parentName, User user, Component component, + Map existingEnvVersions) { Map deploymentResourceArtifacts = ConfigurationManager.getConfigurationManager().getConfiguration().getDeploymentResourceInstanceArtifacts(); if (deploymentResourceArtifacts == null) { log.debug("no deployment artifacts are configured for generated artifacts"); @@ -4594,64 +4750,55 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); } - String envLabel = (artifact.getArtifactLabel() + HEAT_ENV_SUFFIX).toLowerCase(); - String parentIdParam = parentId; - if (!overrideId) { - parentIdParam = null; - } - Either createArtifactPlaceHolder = createArtifactPlaceHolderInfo(parentIdParam, envLabel, placeHolderData, user.getUserId(), ArtifactGroupTypeEnum.DEPLOYMENT, true); + String envLabel = (heatArtifact.getArtifactLabel() + HEAT_ENV_SUFFIX).toLowerCase(); + Either createArtifactPlaceHolder = createArtifactPlaceHolderInfo(parentId, envLabel, placeHolderData, user.getUserId(), ArtifactGroupTypeEnum.DEPLOYMENT, true); if (createArtifactPlaceHolder.isRight()) { return Either.right(createArtifactPlaceHolder.right().value()); } ArtifactDefinition artifactHeatEnv = createArtifactPlaceHolder.left().value(); - if (!overrideId) { - // fix for migration only!!!! create heat env placeholder according to heat id. - artifactHeatEnv.setUniqueId(artifact.getUniqueId() + HEAT_ENV_SUFFIX); - } - - artifactHeatEnv.setGeneratedFromId(artifact.getUniqueId()); + artifactHeatEnv.setGeneratedFromId(heatArtifact.getUniqueId()); artifactHeatEnv.setHeatParamsUpdateDate(System.currentTimeMillis()); artifactHeatEnv.setTimeout(0); - buildHeatEnvFileName(artifact, artifactHeatEnv, placeHolderData); + buildHeatEnvFileName(heatArtifact, artifactHeatEnv, placeHolderData); // rbetzer - keep env artifactVersion - changeComponentInstanceVersion flow handleEnvArtifactVersion(artifactHeatEnv, existingEnvVersions); - // clone heat parameters in case of heat env only not VF heat env - if (envType.equals(HEAT_ENV_NAME)) { - artifactHeatEnv.setHeatParameters(artifact.getHeatParameters()); - } - ArtifactDefinition artifactDefinition; + ArtifactDefinition heatEnvPlaceholder; // Evg : for resource instance artifact will be added later as block with other env artifacts from BL if (parentType != NodeTypeEnum.ResourceInstance) { - Either addHeatEnvArtifact = addHeatEnvArtifact(artifactHeatEnv, artifact, component.getUniqueId(), parentType, parentId); + Either addHeatEnvArtifact = addHeatEnvArtifact(artifactHeatEnv, heatArtifact, component.getUniqueId(), parentType, parentId); if (addHeatEnvArtifact.isRight()) { log.debug("failed to create heat env artifact on resource instance"); return Either.right(componentsUtils.getResponseFormatForResourceInstance(componentsUtils.convertFromStorageResponseForResourceInstance(addHeatEnvArtifact.right().value(), false), "", null)); } - artifactDefinition = createArtifactPlaceHolder.left().value(); + heatEnvPlaceholder = createArtifactPlaceHolder.left().value(); } else { - artifactDefinition = artifactHeatEnv; - artifactToscaOperation.generateUUID(artifactDefinition, artifactDefinition.getArtifactVersion()); - } - - if (artifact.getHeatParameters() != null) { - List heatEnvParameters = new ArrayList(); - for (HeatParameterDefinition parameter : artifact.getListHeatParameters()) { - HeatParameterDefinition heatEnvParameter = new HeatParameterDefinition(parameter); - heatEnvParameter.setDefaultValue(parameter.getCurrentValue()); - heatEnvParameters.add(heatEnvParameter); - } - artifactDefinition.setListHeatParameters(heatEnvParameters); + heatEnvPlaceholder = artifactHeatEnv; + artifactToscaOperation.generateUUID(heatEnvPlaceholder, heatEnvPlaceholder.getArtifactVersion()); + setHeatCurrentValuesOnHeatEnvDefaultValues(heatArtifact, heatEnvPlaceholder); } - // audit - EnumMap artifactAuditingFields = createArtifactAuditingFields(artifactDefinition, "", artifactDefinition.getUniqueId()); + EnumMap artifactAuditingFields = createArtifactAuditingFields(heatEnvPlaceholder, "", heatEnvPlaceholder.getUniqueId()); artifactAuditingFields.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parentName); ComponentTypeEnum componentType = component.getComponentType(); if (parentType == NodeTypeEnum.ResourceInstance) { componentType = ComponentTypeEnum.RESOURCE_INSTANCE; } componentsUtils.auditComponent(componentsUtils.getResponseFormat(ActionStatus.OK), user, component, "", "", AuditingActionEnum.ARTIFACT_UPLOAD, componentType, artifactAuditingFields); - return Either.left(artifactDefinition); + return Either.left(heatEnvPlaceholder); + } + + private void setHeatCurrentValuesOnHeatEnvDefaultValues(ArtifactDefinition artifact, ArtifactDefinition artifactDefinition) { + if (artifact.getListHeatParameters() == null) { + return; + } + List heatEnvParameters = new ArrayList<>(); + for (HeatParameterDefinition parameter : artifact.getListHeatParameters()) { + HeatParameterDefinition heatEnvParameter = new HeatParameterDefinition(parameter); + heatEnvParameter.setDefaultValue(parameter.getCurrentValue()); + heatEnvParameter.setCurrentValue(null); + heatEnvParameters.add(heatEnvParameter); + } + artifactDefinition.setListHeatParameters(heatEnvParameters); } private void buildHeatEnvFileName(ArtifactDefinition heatArtifact, ArtifactDefinition heatEnvArtifact, Map placeHolderData) { @@ -4707,7 +4854,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { if (actionResult.isRight()) { log.debug("Failed to upload artifact to component with type {} and name {}. Status is {}. ", componentType, component.getName(), actionResult.right().value()); errorWrapper.setInnerElement(actionResult.right().value()); - if (operation.getArtifactOperationEnum() == ArtifactOperationEnum.Create) { + if (ArtifactOperationEnum.isCreateOrLink(operation.getArtifactOperationEnum())) { vfcsNewCreatedArtifacts.addAll(uploadedArtifacts); } break; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogic.java index 5b8a10a03e..2e14028338 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogic.java @@ -34,7 +34,6 @@ import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.utils.ComponentValidationUtils; - import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java index 5a4961b24f..14c451a3b0 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java @@ -20,8 +20,12 @@ package org.openecomp.sdc.be.components.impl; -import com.google.gson.JsonElement; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -36,7 +40,16 @@ import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.GroupProperty; +import org.openecomp.sdc.be.model.IComplexDefaultValue; +import org.openecomp.sdc.be.model.IPropertyInputCommon; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; @@ -65,11 +78,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.function.Function; +import com.google.gson.JsonElement; + +import fj.data.Either; public abstract class BaseBusinessLogic { @@ -287,34 +298,6 @@ public abstract class BaseBusinessLogic { return Either.left(componentFound.left().value()); } -// protected Either validateComponentExists(String componentId, ComponentTypeEnum componentType, ComponentParametersView componentParametersView, String userId, -// AuditingActionEnum auditingAction, User user) { -// -// ComponentOperation componentOperation = getComponentOperation(componentType); -// -// if (componentOperation == null) { -// ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR); -// log.debug("addGroup - not supported component type {}", componentType); -// return Either.right(responseFormat); -// } -// Either componentResult = componentOperation.getComponent(componentId, componentParametersView, true); -// -// if (componentResult.isRight()) { -// ActionStatus status = (componentType.equals(ComponentTypeEnum.RESOURCE)) ? ActionStatus.RESOURCE_NOT_FOUND : ActionStatus.SERVICE_NOT_FOUND; -// -// ResponseFormat responseFormat = componentsUtils.getResponseFormat(status, componentId); -// -// log.debug("Service not found, serviceId {}", componentId); -// // ComponentTypeEnum componentForAudit = -// // (componentType.equals(ComponentTypeEnum.RESOURCE)) ? -// // ComponentTypeEnum.RESOURCE : ComponentTypeEnum.SERVICE; -// // handleAuditing(auditingAction, null, componentId, user, null, -// // null, artifactId, responseFormat, componentForAudit, null); -// return Either.right(responseFormat); -// } -// return Either.left(componentResult.left().value()); -// } - public Either validateCanWorkOnComponent(Component component, String userId) { Either canWork = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESTRICTED_OPERATION)); if (component.getLifecycleState() != LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java index 237ec6d5fe..1f5770856b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CassandraHealthCheck.java @@ -1,8 +1,6 @@ package org.openecomp.sdc.be.components.impl; import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java index f97b4cf3f1..31c665686e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java @@ -31,8 +31,6 @@ import java.util.stream.Collectors; import javax.annotation.Resource; -import jersey.repackaged.com.google.common.base.Function; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -52,6 +50,7 @@ import org.springframework.stereotype.Component; import org.yaml.snakeyaml.Yaml; import fj.data.Either; +import jersey.repackaged.com.google.common.base.Function; @Component("commonImportManager") public class CommonImportManager { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java index 108e03c274..40e67aa876 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogic.java @@ -31,14 +31,21 @@ import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; +import org.openecomp.sdc.be.dao.utils.MapUtil; import org.openecomp.sdc.be.datamodel.api.HighestFilterEnum; import org.openecomp.sdc.be.datatypes.components.ServiceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.*; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.CapReqDef; @@ -82,6 +89,12 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { @Autowired protected ComponentCache componentCache; + @Autowired + private GenericTypeBusinessLogic genericTypeBusinessLogic; + + public void setGenericTypeBusinessLogic(GenericTypeBusinessLogic genericTypeBusinessLogic) { + this.genericTypeBusinessLogic = genericTypeBusinessLogic; + } private static Logger log = LoggerFactory.getLogger(ComponentBusinessLogic.class.getName()); @@ -116,7 +129,6 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { componentsUtils.auditComponentAdmin(responseFormat, user, component, "", "", auditAction, component.getComponentType()); return Either.right(responseFormat); } - user = userResult.left().value(); return userResult; } @@ -502,17 +514,6 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { return Either.left(true); } - /*** - * Fetches Component From the DB - * - * @param componentId - * @param componentTypeEnum - * @return - */ - public Either getComponent(String componentId, ComponentTypeEnum componentTypeEnum) { - return toscaOperationFacade.getToscaElement(componentId); - } - public Either getRequirementsAndCapabilities(String componentId, ComponentTypeEnum componentTypeEnum, String userId) { Either resp = validateUserExists(userId, "create Component Instance", false); @@ -545,7 +546,7 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { List componentsUidToFetch = new ArrayList<>(); componentsUidToFetch.addAll(componentUids); - if (componentsUidToFetch.size() > 0) { + if (!componentsUidToFetch.isEmpty()) { log.debug("Number of Components to fetch from graph is {}", componentsUidToFetch.size()); Boolean isHighest = isHighest(highestFilter); Either, StorageOperationStatus> nonCheckoutCompResponse = toscaOperationFacade.getLatestVersionNotAbstractComponents(isAbstractAbstract, isHighest, componentTypeEnum, internalComponentType, componentsUidToFetch); @@ -617,7 +618,7 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { public void setToscaArtifactsPlaceHolders(Component component, User user) { Map artifactMap = component.getToscaArtifacts(); if (artifactMap == null) { - artifactMap = new HashMap(); + artifactMap = new HashMap<>(); } String componentUniqueId = component.getUniqueId(); String componentSystemName = component.getSystemName(); @@ -628,7 +629,7 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { for (Entry artifactInfoMap : toscaArtifacts.entrySet()) { Map artifactInfo = (Map) artifactInfoMap.getValue(); ArtifactDefinition artifactDefinition = artifactsBusinessLogic.createArtifactPlaceHolderInfo(componentUniqueId, artifactInfoMap.getKey(), artifactInfo, user, ArtifactGroupTypeEnum.TOSCA); - artifactDefinition.setArtifactName(componentType + "-" + componentSystemName + artifactInfo.get("artifactName")); + artifactDefinition.setArtifactName(ValidationUtils.normalizeFileName(componentType + "-" + componentSystemName + artifactInfo.get("artifactName"))); artifactMap.put(artifactDefinition.getArtifactLabel(), artifactDefinition); } } @@ -695,7 +696,7 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { List components = latestVersionEither.left().value(); - Component component = components.stream().filter(c -> c.isHighestVersion()).findFirst().orElse(null); + Component component = components.stream().filter(Component::isHighestVersion).findFirst().orElse(null); if(component == null){ component = components.stream().filter(c -> c.getLifecycleState() == LifecycleStateEnum.CERTIFIED).findFirst().orElse(null); } @@ -785,7 +786,6 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { protected Either, ResponseFormat> deleteMarkedComponents(ComponentTypeEnum componentType) { -// List deletedComponents = new ArrayList(); log.trace("start deleteMarkedComponents"); Either, StorageOperationStatus> deleteMarkedElements = toscaOperationFacade.deleteMarkedElements(componentType); @@ -794,30 +794,12 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { ResponseFormat responseFormat = componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(deleteMarkedElements.right().value(), componentType)); return Either.right(responseFormat); } -// ComponentOperation componentOperation = getComponentOperation(componentType); -// Either, StorageOperationStatus> resourcesToDelete = componentOperation.getAllComponentsMarkedForDeletion(); -// if (resourcesToDelete.isRight()) { -// ResponseFormat responseFormat = componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(resourcesToDelete.right().value(), componentType)); -// return Either.right(responseFormat); -// } -// -// for (String resourceToDelete : resourcesToDelete.left().value()) { -// -// Either deleteMarkedResource = deleteMarkedComponent(resourceToDelete, componentType); -// if (deleteMarkedResource.isLeft()) { -// deletedComponents.add(deleteMarkedResource.left().value()); -// } -// } -// if(deletedComponents.size() == 0) { -// log.debug("Component list to delete is empty. do commit"); -// titanGenericDao.commit(); -// } log.trace("end deleteMarkedComponents"); return Either.left(deleteMarkedElements.left().value()); } - public Either, StorageOperationStatus> getComponentArtifactsForDelete(String parentId, NodeTypeEnum parentType, boolean inTransacton) { - List artifacts = new ArrayList(); + public Either, StorageOperationStatus> getComponentArtifactsForDelete(String parentId, NodeTypeEnum parentType) { + List artifacts = new ArrayList<>(); Either, StorageOperationStatus> artifactsResponse = artifactToscaOperation.getArtifacts(parentId); if (artifactsResponse.isRight()) { if (!artifactsResponse.right().value().equals(StorageOperationStatus.NOT_FOUND)) { @@ -827,16 +809,6 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { } else { artifacts.addAll(artifactsResponse.left().value().values()); } - -// if (NodeTypeEnum.Resource.equals(parentType)) { -// Either, StorageOperationStatus> interfacesArtifactsForResource = getAdditionalArtifacts(parentId, false, true); -// if (artifactsResponse.isRight() && !interfacesArtifactsForResource.right().value().equals(StorageOperationStatus.NOT_FOUND)) { -// log.debug("failed to retrieve interface artifacts for {} {}", parentType, parentId); -// return Either.right(interfacesArtifactsForResource.right().value()); -// } else if (artifactsResponse.isLeft()) { -// artifacts.addAll(interfacesArtifactsForResource.left().value()); -// } -// } return Either.left(artifacts); } @@ -873,50 +845,39 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { return Either.left(result); } - protected void generateInputsFromGenericTypeProperties(T component, Resource genericType) { - - List genericTypeProps = genericType.getProperties(); - if(null != genericTypeProps) { - String genericUniqueId = genericType.getUniqueId(); - List inputs = convertGenericTypePropertiesToInputsDefintion(genericTypeProps, genericUniqueId); - if(null != component.getInputs()) - inputs.addAll(component.getInputs()); - component.setInputs(inputs); - } - } - - private List convertGenericTypePropertiesToInputsDefintion(List genericTypeProps, String genericUniqueId) { - return genericTypeProps.stream() - .map(p -> setInputDefinitionFromProp(p, genericUniqueId)) - .collect(Collectors.toList()); + protected void generateAndAddInputsFromGenericTypeProperties(T component, Resource genericType) { + List genericAndComponentInputs = new ArrayList<>(); + List genericInputs = genericTypeBusinessLogic.generateInputsFromGenericTypeProperties(genericType); + genericAndComponentInputs.addAll(genericInputs); + if (null != component.getInputs()){ + List nonGenericInputsFromComponent = getAllNonGenericInputsFromComponent(genericInputs, component.getInputs()); + genericAndComponentInputs.addAll(nonGenericInputsFromComponent); + } + component.setInputs(genericAndComponentInputs); } - - private InputDefinition setInputDefinitionFromProp(PropertyDefinition prop, String genericUniqueId){ - InputDefinition input = new InputDefinition(prop); - input.setOwnerId(genericUniqueId); - return input; + + private List getAllNonGenericInputsFromComponent(List genericInputs, List componentInputs) { + if (genericInputs == null) { + return componentInputs; + } + + Map inputByNameMap = MapUtil.toMap(genericInputs, InputDefinition::getName); + List componentNonGenericInputs = new ArrayList<>(); + componentInputs.stream().forEach(input -> { + if (!inputByNameMap.containsKey(input.getName())) { + componentNonGenericInputs.add(input); + } + }); + return componentNonGenericInputs; } protected Either fetchAndSetDerivedFromGenericType(T component){ - String genericTypeToscaName = null; - if(component.getComponentType() == ComponentTypeEnum.RESOURCE && ((Resource)component).getResourceType() == ResourceTypeEnum.CVFC && CollectionUtils.isNotEmpty(((Resource)component).getDerivedFrom())){ - genericTypeToscaName = ((Resource)component).getDerivedFrom().get(0); - } else { - genericTypeToscaName = component.fetchGenericTypeToscaNameFromConfig(); - } - log.debug("Fetching generic tosca name {}", genericTypeToscaName); - if(null == genericTypeToscaName) { - log.debug("Failed to fetch certified node type by tosca resource name {}", genericTypeToscaName); - return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + Either genericTypeEither = this.genericTypeBusinessLogic.fetchDerivedFromGenericType(component); + if(genericTypeEither.isRight()){ + log.debug("Failed to fetch latest generic type for component {} of type", component.getName(), component.assetType()); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERIC_TYPE_NOT_FOUND, component.assetType())); } - - Either findLatestGeneric = toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(genericTypeToscaName); - if(findLatestGeneric.isRight()){ - log.debug("Failed to fetch certified node type by tosca resource name {}", genericTypeToscaName); - return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERIC_TYPE_NOT_FOUND, component.assetType(), genericTypeToscaName)); - } - - Resource genericTypeResource = findLatestGeneric.left().value(); + Resource genericTypeResource = genericTypeEither.left().value(); component.setDerivedFromGenericInfo(genericTypeResource); return Either.left(genericTypeResource); } @@ -1119,7 +1080,7 @@ public abstract class ComponentBusinessLogic extends BaseBusinessLogic { return shouldUpgradeNodeType(componentToCheckOut, latestGeneric); } List genericTypeProps = latestGeneric.getProperties(); - List genericTypeInputs = null == genericTypeProps? null : convertGenericTypePropertiesToInputsDefintion(genericTypeProps, latestGeneric.getUniqueId()); + List genericTypeInputs = null == genericTypeProps? null : genericTypeBusinessLogic.convertGenericTypePropertiesToInputsDefintion(genericTypeProps, latestGeneric.getUniqueId()); List currentList = new ArrayList<>(); // nullify existing ownerId from existing list and merge into updated list if (null != componentToCheckOut.getInputs()) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java index 66d8668fea..b86b28a6c5 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java @@ -21,6 +21,8 @@ package org.openecomp.sdc.be.components.impl; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -32,23 +34,28 @@ import java.util.UUID; import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; +import org.openecomp.sdc.be.components.merge.instance.ComponentInstanceMergeDataBusinessLogic; +import org.openecomp.sdc.be.components.merge.instance.DataForMergeHolder; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.info.CreateAndAssotiateInfo; import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; @@ -59,7 +66,10 @@ import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; @@ -95,7 +105,10 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { private ArtifactsBusinessLogic artifactBusinessLogic; @Autowired private ApplicationDataTypeCache dataTypeCache; - + + @Autowired + private ComponentInstanceMergeDataBusinessLogic compInstMergeDataBL; + public static final String VF_MODULE = "org.openecomp.groups.VfModule"; public ComponentInstanceBusinessLogic() { @@ -112,8 +125,8 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { User user = null; org.openecomp.sdc.be.model.Component containerComponent = null; ComponentTypeEnum containerComponentType; - - try{ + + try { Either resp = validateUserExists(userId, "create Component Instance", inTransaction); if (resp.isRight()) { return Either.right(resp.right().value()); @@ -125,37 +138,56 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { if (validateValidJson.isRight()) { return Either.right(validateValidJson.right().value()); } - + Either validateComponentType = validateComponentType(containerComponentParam); if (validateComponentType.isRight()) { return Either.right(validateComponentType.right().value()); } else { containerComponentType = validateComponentType.left().value(); } - + Either validateComponentExists = validateComponentExists(containerComponentId, containerComponentType, null); if (validateComponentExists.isRight()) { return Either.right(validateComponentExists.right().value()); } else { containerComponent = validateComponentExists.left().value(); } - + if (ModelConverter.isAtomicComponent(containerComponent)) { log.debug("Cannot attach resource instances to container resource of type {}", containerComponent.assetType()); return Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_CANNOT_CONTAIN_RESOURCE_INSTANCES, containerComponent.assetType())); } - + Either validateCanWorkOnComponent = validateCanWorkOnComponent(containerComponent, userId); if (validateCanWorkOnComponent.isRight()) { return Either.right(validateCanWorkOnComponent.right().value()); } - + if (resourceInstance != null && containerComponentType != null) { - Either getOriginComponentRes = getAndValidateOriginComponentOfComponentInstance(containerComponentType, resourceInstance); - if (getOriginComponentRes.isRight()) { - return Either.right(getOriginComponentRes.right().value()); + OriginTypeEnum originType = resourceInstance.getOriginType(); + if (originType == OriginTypeEnum.ServiceProxy) { + Either serviceProxyOrigin = toscaOperationFacade.getLatestByName("serviceProxy"); + if (serviceProxyOrigin.isRight()) { + log.debug("Failed to fetch normative service proxy resource by tosca name, error {}", serviceProxyOrigin.right().value()); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(serviceProxyOrigin.right().value()))); + } + origComponent = serviceProxyOrigin.left().value(); + + StorageOperationStatus fillProxyRes = fillProxyInstanceData(resourceInstance, origComponent); + if (fillProxyRes != StorageOperationStatus.OK) { + log.debug("Failed to fill service proxy resource data with data from service, error {}", fillProxyRes); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(fillProxyRes))); + + } + } else { - origComponent = getOriginComponentRes.left().value(); + Either getOriginComponentRes = getAndValidateOriginComponentOfComponentInstance(containerComponentType, resourceInstance); + + if (getOriginComponentRes.isRight()) { + return Either.right(getOriginComponentRes.right().value()); + } else { + origComponent = getOriginComponentRes.left().value(); + } } } if (needLock) { @@ -174,6 +206,43 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } } + private StorageOperationStatus fillProxyInstanceData(ComponentInstance resourceInstance, Component proxyTemplate) { + resourceInstance.setIsProxy(true); + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreCapabilities(false); + filter.setIgnoreCapabiltyProperties(false); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreRequirements(false); + Either serviceRes = toscaOperationFacade.getToscaElement(resourceInstance.getComponentUid(), filter); + if (serviceRes.isRight()) { + return serviceRes.right().value(); + } + Component service = serviceRes.left().value(); + Map> capabilities = service.getCapabilities(); + resourceInstance.setCapabilities(capabilities); + Map> req = service.getRequirements(); + resourceInstance.setRequirements(req); + + String name = service.getNormalizedName() + ToscaOperationFacade.PROXY_SUFFIX; + String toscaResourceName = ((Resource) proxyTemplate).getToscaResourceName(); + int lastIndexOf = toscaResourceName.lastIndexOf('.'); + if (lastIndexOf != -1) { + String proxyToscaName = toscaResourceName.substring(0, lastIndexOf + 1) + name; + resourceInstance.setToscaComponentName(proxyToscaName); + } + resourceInstance.setName(name); + resourceInstance.setIsProxy(true); + resourceInstance.setSourceModelInvariant(service.getInvariantUUID()); + resourceInstance.setSourceModelName(service.getName()); + resourceInstance.setSourceModelUuid(service.getUUID()); + resourceInstance.setSourceModelUid(service.getUniqueId()); + resourceInstance.setComponentUid(proxyTemplate.getUniqueId()); + resourceInstance.setDescription("A Proxy for Service " + service.getName()); + resourceInstance.setComponentVersion(service.getVersion()); + + return StorageOperationStatus.OK; + } + public Either createAndAssociateRIToRI(String containerComponentParam, String containerComponentId, String userId, CreateAndAssotiateInfo createAndAssotiateInfo) { Either resultOp = null; @@ -216,7 +285,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { try { log.debug("Try to create entry on graph"); - Either eitherResourceName = getOriginComponentNameFromComponentInstance(resourceInstance, true); + Either eitherResourceName = getOriginComponentFromComponentInstance(resourceInstance, true); if (eitherResourceName.isRight()) { resultOp = Either.right(eitherResourceName.right().value()); @@ -260,7 +329,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } } - private Either getOriginComponentNameFromComponentInstance(ComponentInstance componentInstance, boolean inTransaction) { + private Either getOriginComponentFromComponentInstance(ComponentInstance componentInstance, boolean inTransaction) { Either eitherResponse; Either eitherComponent = toscaOperationFacade.getToscaFullElement(componentInstance.getComponentUid()); if (eitherComponent.isRight()) { @@ -286,7 +355,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { log.debug("Entity on graph is created."); Component updatedComponent = result.left().value().getLeft(); Map existingEnvVersions = new HashMap<>(); - //TODO existingEnvVersions ?? + // TODO existingEnvVersions ?? Either addComponentInstanceArtifacts = addComponentInstanceArtifacts(updatedComponent, componentInstance, originComponent, user, existingEnvVersions); if (addComponentInstanceArtifacts.isRight()) { log.debug("Failed to create component instance {}", componentInstance.getName()); @@ -304,19 +373,17 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { return resultOp; } - /** - * addResourceInstanceArtifacts - add artifacts (HEAT_ENV) to resource instance The instance artifacts are generated from the resource's artifacts - * - * @param componentInstance - * @param userId - * @param existingEnvVersions - * TODO - * @param containerComponentId - * - * @return - */ - protected Either addComponentInstanceArtifacts(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance componentInstance, org.openecomp.sdc.be.model.Component originComponent, User user, - Map existingEnvVersions) { +/** + * addResourceInstanceArtifacts - add artifacts (HEAT_ENV) to resource instance The instance artifacts are generated from the resource's artifacts + * @param containerComponent + * @param componentInstance + * @param originComponent + * @param user + * @param existingEnvVersions + * @return + */ + protected Either addComponentInstanceArtifacts(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance componentInstance, org.openecomp.sdc.be.model.Component originComponent, User user, Map existingEnvVersions) { + log.debug("add artifacts to resource instance"); List filteredGroups = null; ActionStatus status = setResourceArtifactsOnResourceInstance(componentInstance); @@ -324,80 +391,72 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { ResponseFormat resultOp = componentsUtils.getResponseFormatForResourceInstance(status, "", null); return Either.right(resultOp); } - + StorageOperationStatus artStatus; // generate heat_env if necessary Map componentDeploymentArtifacts = componentInstance.getDeploymentArtifacts(); - if (componentDeploymentArtifacts == null) { - return Either.left(ActionStatus.OK); - } - Map finalDeploymentArtifacts = new HashMap(); - - Map> groupInstancesArtifacts = new HashMap<>(); - - for (ArtifactDefinition artifact : componentDeploymentArtifacts.values()) { - String type = artifact.getArtifactType(); + if (MapUtils.isNotEmpty(componentDeploymentArtifacts)) { - if ( !type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_ENV.getType()) ){ - finalDeploymentArtifacts.put(artifact.getArtifactLabel(), artifact); - } - - if (!(type.equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType()) || type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_NET.getType()) || type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType()))) { - continue; - } + Map finalDeploymentArtifacts = new HashMap(); + Map> groupInstancesArtifacts = new HashMap<>(); - if (artifact.checkEsIdExist()) { - Either createHeatEnvPlaceHolder = artifactBusinessLogic.createHeatEnvPlaceHolder(artifact, ArtifactsBusinessLogic.HEAT_ENV_NAME, componentInstance.getUniqueId(), NodeTypeEnum.ResourceInstance, - componentInstance.getName(), user, containerComponent, existingEnvVersions); - if (createHeatEnvPlaceHolder.isRight()) { - return Either.right(createHeatEnvPlaceHolder.right().value()); + for (ArtifactDefinition artifact : componentDeploymentArtifacts.values()) { + String type = artifact.getArtifactType(); + if (!type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_ENV.getType())) { + finalDeploymentArtifacts.put(artifact.getArtifactLabel(), artifact); } - ArtifactDefinition artifactDefinition = createHeatEnvPlaceHolder.left().value(); - - //put env - finalDeploymentArtifacts.put(artifactDefinition.getArtifactLabel(), artifactDefinition); - - if(CollectionUtils.isNotEmpty(originComponent.getGroups())){ - filteredGroups = originComponent.getGroups().stream().filter(g -> g.getType().equals(VF_MODULE)).collect(Collectors.toList()); + if (!(type.equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType()) || type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_NET.getType()) || type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType()))) { + continue; } - if (CollectionUtils.isNotEmpty(filteredGroups)) { - for (GroupDefinition groupInstance : filteredGroups) { - Optional op = groupInstance.getArtifacts().stream().filter(p -> p.equals(artifactDefinition.getGeneratedFromId())).findAny(); - if (op.isPresent()) { - List artifactsUid; - if (groupInstancesArtifacts.containsKey(groupInstance.getUniqueId())) { - artifactsUid = groupInstancesArtifacts.get(groupInstance.getUniqueId()); - } else { - artifactsUid = new ArrayList<>(); + if (artifact.checkEsIdExist()) { + Either createHeatEnvPlaceHolder = artifactBusinessLogic.createHeatEnvPlaceHolder(artifact, ArtifactsBusinessLogic.HEAT_ENV_NAME, componentInstance.getUniqueId(), NodeTypeEnum.ResourceInstance, + componentInstance.getName(), user, containerComponent, existingEnvVersions); + if (createHeatEnvPlaceHolder.isRight()) { + return Either.right(createHeatEnvPlaceHolder.right().value()); + } + ArtifactDefinition artifactDefinition = createHeatEnvPlaceHolder.left().value(); + // put env + finalDeploymentArtifacts.put(artifactDefinition.getArtifactLabel(), artifactDefinition); + + if (CollectionUtils.isNotEmpty(originComponent.getGroups())) { + filteredGroups = originComponent.getGroups().stream().filter(g -> g.getType().equals(VF_MODULE)).collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(filteredGroups)) { + for (GroupDefinition groupInstance : filteredGroups) { + Optional op = groupInstance.getArtifacts().stream().filter(p -> p.equals(artifactDefinition.getGeneratedFromId())).findAny(); + if (op.isPresent()) { + List artifactsUid; + if (groupInstancesArtifacts.containsKey(groupInstance.getUniqueId())) { + artifactsUid = groupInstancesArtifacts.get(groupInstance.getUniqueId()); + } else { + artifactsUid = new ArrayList<>(); + } + artifactsUid.add(artifactDefinition); + groupInstancesArtifacts.put(groupInstance.getUniqueId(), artifactsUid); + break; } - artifactsUid.add(artifactDefinition); - groupInstancesArtifacts.put(groupInstance.getUniqueId(), artifactsUid); - break; } } - } } + artStatus = toscaOperationFacade.addDeploymentArtifactsToInstance(containerComponent.getUniqueId(), componentInstance, finalDeploymentArtifacts); + if (artStatus != StorageOperationStatus.OK) { + log.debug("Failed to add instance deployment artifacts for instance {} in conatiner {} error {}", componentInstance.getUniqueId(), containerComponent.getUniqueId(), artStatus); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(artStatus, false))); + + } + StorageOperationStatus result = toscaOperationFacade.addGroupInstancesToComponentInstance(containerComponent, componentInstance, filteredGroups, groupInstancesArtifacts); + if (result != StorageOperationStatus.OK) { + log.debug("failed to update group instance for component instance {}", componentInstance.getUniqueId()); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(result))); + } + componentInstance.setDeploymentArtifacts(finalDeploymentArtifacts); } - StorageOperationStatus artStatus = toscaOperationFacade.addDeploymentArtifactsToInstance(containerComponent.getUniqueId(), componentInstance, finalDeploymentArtifacts); - if ( artStatus != StorageOperationStatus.OK){ - log.debug("Failed to add instance deployment artifacts for instance {} in conatiner {} error {}", componentInstance.getUniqueId(), containerComponent.getUniqueId(), artStatus); - return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(artStatus, false))); - - } - StorageOperationStatus result = toscaOperationFacade - .addGroupInstancesToComponentInstance(containerComponent, componentInstance, filteredGroups, groupInstancesArtifacts); - if (result != StorageOperationStatus.OK) { - log.debug("failed to update group instance for component instance {}", componentInstance.getUniqueId()); - return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(result))); - } - componentInstance.setDeploymentArtifacts(finalDeploymentArtifacts); - - + artStatus = toscaOperationFacade.addInformationalArtifactsToInstance(containerComponent.getUniqueId(), componentInstance, originComponent.getArtifacts()); - if ( artStatus != StorageOperationStatus.OK){ + if (artStatus != StorageOperationStatus.OK) { log.debug("Failed to add informational artifacts to the instance {} belonging to the conatiner {}. Status is {}", componentInstance.getUniqueId(), containerComponent.getUniqueId(), artStatus); return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(artStatus, false))); - + } componentInstance.setArtifacts(originComponent.getArtifacts()); return Either.left(ActionStatus.OK); @@ -483,7 +542,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } try { - Either eitherResourceName = getOriginComponentNameFromComponentInstance(componentInstance, inTransaction); + Either eitherResourceName = getOriginComponentFromComponentInstance(componentInstance, inTransaction); if (eitherResourceName.isRight()) { resultOp = Either.right(eitherResourceName.right().value()); @@ -557,42 +616,40 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { List updatedList = new ArrayList<>(); List instancesFromContainerComponent = containerComponent.getComponentInstances(); List listForUpdate = new ArrayList<>(); - if(instancesFromContainerComponent == null || instancesFromContainerComponent.isEmpty()) + if (instancesFromContainerComponent == null || instancesFromContainerComponent.isEmpty()) containerComponent.setComponentInstances(componentInstanceList); - else{ + else { Iterator iterator = instancesFromContainerComponent.iterator(); - while(iterator.hasNext()){ + while (iterator.hasNext()) { ComponentInstance origInst = iterator.next(); Optional op = componentInstanceList.stream().filter(ci -> ci.getUniqueId().equals(origInst.getUniqueId())).findAny(); - if(op.isPresent()){ - ComponentInstance updatedCi = op.get(); + if (op.isPresent()) { + ComponentInstance updatedCi = op.get(); updatedCi = buildComponentInstance(updatedCi, origInst); - + Boolean isUniqueName = validateInstanceNameUniquenessUponUpdate(containerComponent, origInst, updatedCi.getName()); - if(!isUniqueName){ - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the name of the component instance {} to {}. A component instance with the same name already exists. ", - origInst.getName(), updatedCi.getName()); + if (!isUniqueName) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the name of the component instance {} to {}. A component instance with the same name already exists. ", origInst.getName(), updatedCi.getName()); resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.COMPONENT_NAME_ALREADY_EXIST, containerComponentType.getValue(), origInst.getName())); return resultOp; } - + listForUpdate.add(updatedCi); - } - else + } else listForUpdate.add(origInst); } containerComponent.setComponentInstances(listForUpdate); - - if(resultOp == null){ - Either updateStatus = toscaOperationFacade.updateComponentInstanceMetadataOfTopologyTemplate(containerComponent); - if(updateStatus.isRight()){ + + if (resultOp == null) { + Either updateStatus = toscaOperationFacade.updateComponentInstanceMetadataOfTopologyTemplate(containerComponent, componentFilter); + if (updateStatus.isRight()) { CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update metadata belonging to container component {}. Status is {}. ", containerComponent.getName(), updateStatus.right().value()); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstance(componentsUtils.convertFromStorageResponseForResourceInstance(updateStatus.right().value(), true), "", null)); return resultOp; } - for(ComponentInstance updatedInstance : updateStatus.left().value().getComponentInstances()){ + for (ComponentInstance updatedInstance : updateStatus.left().value().getComponentInstances()) { Optional op = componentInstanceList.stream().filter(ci -> ci.getName().equals(updatedInstance.getName())).findAny(); - if(op.isPresent()){ + if (op.isPresent()) { updatedList.add(updatedInstance); } } @@ -640,8 +697,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { if (resultOp == null) { oldComponentInstance = componentInstanceOptional.get(); String newInstanceName = componentInstance.getName(); - if ( oldComponentInstance!=null && oldComponentInstance.getName() != null - && !oldComponentInstance.getName().equals( newInstanceName ) ) + if (oldComponentInstance != null && oldComponentInstance.getName() != null && !oldComponentInstance.getName().equals(newInstanceName)) isNameChanged = true; Boolean isUniqueName = validateInstanceNameUniquenessUponUpdate(containerComponent, oldComponentInstance, newInstanceName); if (!isUniqueName) { @@ -655,14 +711,14 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update metadata of component instance {} belonging to container component {}. Status is {}. ", componentInstance.getName(), containerComponent.getName(), updateRes.right().value()); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstance(componentsUtils.convertFromStorageResponseForResourceInstance(updateRes.right().value(), true), "", null)); - }else{ - //region - Update instance Groups - if ( isNameChanged ){ - Either result = toscaOperationFacade.cleanAndAddGroupInstancesToComponentInstance( containerComponent ,oldComponentInstance ,componentInstanceId ); - if ( result.isRight() ) - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to rename group instances for container {}. error {} ", componentInstanceId ,result.right().value() ); + } else { + // region - Update instance Groups + if (isNameChanged) { + Either result = toscaOperationFacade.cleanAndAddGroupInstancesToComponentInstance(containerComponent, oldComponentInstance, componentInstanceId); + if (result.isRight()) + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to rename group instances for container {}. error {} ", componentInstanceId, result.right().value()); } - //endregion + // endregion } } if (resultOp == null) { @@ -672,24 +728,28 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { if (!updatedInstanceOptional.isPresent()) { log.debug("Failed to update metadata of component instance {} of container component {}", componentInstance.getName(), containerComponent.getName()); resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER, componentInstance.getName())); - }else{ + } else { resultOp = Either.left(updatedInstanceOptional.get()); } - + } if (resultOp == null) { resultOp = Either.left(componentInstanceOptional.get()); } return resultOp; } + /** - * @param oldPrefix- The normalized old vf name - * @param newNormailzedPrefix- The normalized new vf name - * @param qualifiedGroupInstanceName- old Group Instance Name + * @param oldPrefix- + * The normalized old vf name + * @param newNormailzedPrefix- + * The normalized new vf name + * @param qualifiedGroupInstanceName- + * old Group Instance Name **/ - //modify group names - private String getNewGroupName( String oldPrefix ,String newNormailzedPrefix , String qualifiedGroupInstanceName){ - if (qualifiedGroupInstanceName == null){ + // modify group names + private String getNewGroupName(String oldPrefix, String newNormailzedPrefix, String qualifiedGroupInstanceName) { + if (qualifiedGroupInstanceName == null) { log.info("CANNOT change group name "); return null; } @@ -702,9 +762,8 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { oldComponentInstance.setName(newComponentInstance.getName()); oldComponentInstance.setModificationTime(System.currentTimeMillis()); oldComponentInstance.setCustomizationUUID(UUID.randomUUID().toString()); - if ( oldComponentInstance.getGroupInstances() != null ) - oldComponentInstance.getGroupInstances().forEach( group -> - group.setName( getNewGroupName( oldComponentInstance.getNormalizedName() , ValidationUtils.normalizeComponentInstanceName( newComponentInstance.getName() ) , group.getName() ) ) ); + if (oldComponentInstance.getGroupInstances() != null) + oldComponentInstance.getGroupInstances().forEach(group -> group.setName(getNewGroupName(oldComponentInstance.getNormalizedName(), ValidationUtils.normalizeComponentInstanceName(newComponentInstance.getName()), group.getName()))); return oldComponentInstance; } @@ -772,26 +831,25 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } if (resultOp.isLeft() && CollectionUtils.isNotEmpty(containerComponent.getGroups())) { List groupsToUpdate = new ArrayList<>(); - for(GroupDataDefinition currGroup : containerComponent.getGroups()){ - if(currGroup.getMembers().containsKey(deletedInstance.getName())){ - currGroup.getMembers().remove(deletedInstance.getName()); + for (GroupDataDefinition currGroup : containerComponent.getGroups()) { + Map members = currGroup.getMembers(); + if (members != null && members.containsKey(deletedInstance.getName())) { + members.remove(deletedInstance.getName()); groupsToUpdate.add(currGroup); } } - Either, StorageOperationStatus> updateGroupsRes = - toscaOperationFacade.updateGroupsOnComponent(containerComponent, containerComponent.getComponentType(), groupsToUpdate); + Either, StorageOperationStatus> updateGroupsRes = toscaOperationFacade.updateGroupsOnComponent(containerComponent, containerComponent.getComponentType(), groupsToUpdate); if (updateGroupsRes.isRight()) { log.debug("Failed to delete component instance {} from group members. ", componentInstanceId); ActionStatus status = componentsUtils.convertFromStorageResponse(updateGroupsRes.right().value(), containerComponentType); resultOp = Either.right(componentsUtils.getResponseFormat(status, componentInstanceId)); } } - if(resultOp.isLeft() && CollectionUtils.isNotEmpty(containerComponent.getInputs())){ + if (resultOp.isLeft() && CollectionUtils.isNotEmpty(containerComponent.getInputs())) { List inputsToDelete = containerComponent.getInputs().stream().filter(i -> i.getInstanceUniqueId() != null && i.getInstanceUniqueId().equals(componentInstanceId)).collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(inputsToDelete)){ - StorageOperationStatus deleteInputsRes = - toscaOperationFacade.deleteComponentInstanceInputsFromTopologyTemplate(containerComponent, containerComponent.getComponentType(), inputsToDelete); - if(deleteInputsRes != StorageOperationStatus.OK){ + if (CollectionUtils.isNotEmpty(inputsToDelete)) { + StorageOperationStatus deleteInputsRes = toscaOperationFacade.deleteComponentInstanceInputsFromTopologyTemplate(containerComponent, containerComponent.getComponentType(), inputsToDelete); + if (deleteInputsRes != StorageOperationStatus.OK) { log.debug("Failed to delete inputs of the component instance {} from container component. ", componentInstanceId); resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(deleteInputsRes, containerComponentType), componentInstanceId)); } @@ -802,8 +860,8 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { private ComponentInstance findAndRemoveComponentInstanceFromContainerComponent(String componentInstanceId, Component containerComponent) { ComponentInstance foundInstance = null; - for(ComponentInstance instance : containerComponent.getComponentInstances()){ - if(instance.getUniqueId().equals(componentInstanceId)){ + for (ComponentInstance instance : containerComponent.getComponentInstances()) { + if (instance.getUniqueId().equals(componentInstanceId)) { foundInstance = instance; containerComponent.getComponentInstances().remove(instance); break; @@ -885,7 +943,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { toNameOrId = toResult.left().value().getName(); } - resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(result.right().value(), true), fromNameOrId, toNameOrId, requirementDef.getRelationships().get(0).getRequirement())); + resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(result.right().value(), true), fromNameOrId, toNameOrId, requirementDef.getRelationships().get(0).getRelation().getRequirement())); return resultOp; } @@ -941,13 +999,156 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } resultOp = Either - .right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(result.right().value(), true), fromNameOrId, toNameOrId, requirementDef.getRelationships().get(0).getRequirement())); + .right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponseForResourceInstance(result.right().value(), true), fromNameOrId, toNameOrId, requirementDef.getRelationships().get(0).getRelation().getRequirement())); return resultOp; } } finally { unlockComponent(resultOp, containerComponent); } } + /** + * Allows to get relation contained in specified component according to received Id + * @param componentId + * @param relationId + * @param userId + * @param componentTypeEnum + * @return + */ + public Either getRelationById(String componentId, String relationId, String userId, ComponentTypeEnum componentTypeEnum) { + + Either resultOp = null; + try { + org.openecomp.sdc.be.model.Component containerComponent = null; + Either validateComponentExists = null; + RequirementCapabilityRelDef foundRelation = null; + + Either validateUserRes = validateUserExists(userId, "get relation by Id", false); + if (validateUserRes.isRight()) { + resultOp = Either.right(validateUserRes.right().value()); + } + if(resultOp == null){ + validateComponentExists = validateComponentExists(componentId, componentTypeEnum, null); + if (validateComponentExists.isRight()) { + resultOp = Either.right(validateComponentExists.right().value()); + } + } + if(resultOp == null){ + containerComponent = validateComponentExists.left().value(); + List requirementCapabilityRelations = containerComponent.getComponentInstancesRelations(); + foundRelation = findRelation(relationId, requirementCapabilityRelations); + if(foundRelation == null){ + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.RELATION_NOT_FOUND, relationId, componentId); + log.debug("Relation with id {} was not found on the component", relationId, componentId); + resultOp = Either.right(responseFormat); + } + } + if(resultOp == null){ + resultOp = setRelatedCapability(foundRelation, containerComponent); + } + if(resultOp.isLeft()){ + resultOp = setRelatedRequirement(foundRelation, containerComponent); + } + } catch (Exception e) { + log.error("The exception {} occured upon get relation {} of the component {} ", e, relationId, componentId); + resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + return resultOp; + } + + private RequirementCapabilityRelDef findRelation(String relationId, List requirementCapabilityRelations) { + for(RequirementCapabilityRelDef relationship : requirementCapabilityRelations){ + if(relationship.getRelationships().stream().filter(r -> r.getRelation().getId().equals(relationId)).findFirst().isPresent()){ + return relationship; + } + } + return null; + } + + private Either setRelatedRequirement(RequirementCapabilityRelDef foundRelation, Component containerComponent) { + Either result = null; + RelationshipInfo relationshipInfo = foundRelation.getSingleRelationship().getRelation(); + String instanceId = foundRelation.getFromNode(); + Optional foundRequirement; + Optional instance = containerComponent.getComponentInstances().stream().filter(i -> i.getUniqueId().equals(instanceId)).findFirst(); + if(!instance.isPresent()){ + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER, instanceId, "instance", containerComponent.getComponentType().getValue(), containerComponent.getName()); + log.debug("Component instance with id {} was not found on the component", instanceId, containerComponent.getUniqueId()); + result = Either.right(responseFormat); + } + if(result == null){ + for(List requirements : instance.get().getRequirements().values()){ + foundRequirement = requirements.stream().filter(r -> isBelongingRequirement(relationshipInfo, r)).findFirst(); + if(foundRequirement.isPresent()){ + foundRelation.getSingleRelationship().setRequirement(foundRequirement.get()); + result = Either.left(foundRelation); + } + } + } + if(result == null){ + Either getfulfilledRequirementRes = toscaOperationFacade.getFulfilledRequirementByRelation(containerComponent.getUniqueId(), instanceId, foundRelation, (rel, req)->isBelongingRequirement(rel, req)); + if(getfulfilledRequirementRes.isRight()){ + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.REQUIREMENT_OF_INSTANCE_NOT_FOUND_ON_CONTAINER, relationshipInfo.getRequirement(), instanceId, containerComponent.getUniqueId()); + log.debug("Requirement {} of instance {} was not found on the container {}. ", relationshipInfo.getCapability(), instanceId, containerComponent.getUniqueId()); + result = Either.right(responseFormat); + } else { + foundRelation.getSingleRelationship().setRequirement(getfulfilledRequirementRes.left().value()); + } + } + if(result == null){ + result = Either.left(foundRelation); + } + return result; + } + + private boolean isBelongingRequirement(RelationshipInfo relationshipInfo, RequirementDataDefinition req) { + return req.getRelationship().equals(relationshipInfo.getRelationship().getType()) && + req.getName().equals(relationshipInfo.getRequirement()) && + req.getUniqueId().equals(relationshipInfo.getRequirementUid()) && + req.getOwnerId().equals(relationshipInfo.getRequirementOwnerId()); + } + + private Either setRelatedCapability(RequirementCapabilityRelDef foundRelation, Component containerComponent) { + Either result = null; + RelationshipInfo relationshipInfo = foundRelation.getSingleRelationship().getRelation(); + String instanceId = foundRelation.getToNode(); + Optional foundCapability; + Optional instance = containerComponent.getComponentInstances().stream().filter(i -> i.getUniqueId().equals(instanceId)).findFirst(); + if(!instance.isPresent()){ + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER, instanceId, "instance", containerComponent.getComponentType().getValue(), containerComponent.getName()); + log.debug("Component instance with id {} was not found on the component", instanceId, containerComponent.getUniqueId()); + result = Either.right(responseFormat); + } + if(result == null){ + for(List capabilities : instance.get().getCapabilities().values()){ + foundCapability = capabilities.stream().filter(c -> isBelongingCapability(relationshipInfo, c)).findFirst(); + if(foundCapability.isPresent()){ + foundRelation.getSingleRelationship().setCapability(foundCapability.get()); + result = Either.left(foundRelation); + } + } + } + if(result == null){ + Either getfulfilledRequirementRes = + toscaOperationFacade.getFulfilledCapabilityByRelation(containerComponent.getUniqueId(), instanceId, foundRelation, (rel, cap)->isBelongingCapability(rel, cap)); + if(getfulfilledRequirementRes.isRight()){ + ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.CAPABILITY_OF_INSTANCE_NOT_FOUND_ON_CONTAINER, relationshipInfo.getCapability(), instanceId, containerComponent.getUniqueId()); + log.debug("Capability {} of instance {} was not found on the container {}. ", relationshipInfo.getCapability(), instanceId, containerComponent.getUniqueId()); + result = Either.right(responseFormat); + } else { + foundRelation.getSingleRelationship().setCapability(getfulfilledRequirementRes.left().value()); + } + } + if(result == null){ + result = Either.left(foundRelation); + } + return result; + } + + private boolean isBelongingCapability(RelationshipInfo relationshipInfo, CapabilityDataDefinition cap) { + return cap.getName().equals(relationshipInfo.getCapability()) && + cap.getUniqueId().equals(relationshipInfo.getCapabilityUid()) && + cap.getOwnerId().equals(relationshipInfo.getCapabilityOwnerId()); + } private Either updateAttributeValue(ComponentInstanceProperty attribute, String resourceInstanceId) { Either eitherAttribute = componentInstanceOperation.updateAttributeValueInResourceInstance(attribute, resourceInstanceId, true); @@ -999,7 +1200,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { /** * Create Or Updates Attribute Instance - * + * * @param componentTypeEnum * @param componentId * @param resourceInstanceId @@ -1047,28 +1248,82 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } } - // US833308 VLI in service - specific network_role property value logic + private boolean isNetworkRoleServiceProperty(ComponentInstanceProperty property, ComponentTypeEnum componentTypeEnum) { + return StringUtils.isNotEmpty(property.getValue()) + && PropertyNames.NETWORK_ROLE.getPropertyName().equalsIgnoreCase(property.getName()) + && ComponentTypeEnum.SERVICE == componentTypeEnum; + } + private StorageOperationStatus concatServiceNameToVLINetworkRolePropertyValue(ToscaOperationFacade toscaOperationFacade, ComponentTypeEnum componentTypeEnum, String componentId, String resourceInstanceId, ComponentInstanceProperty property) { - if (StringUtils.isNotEmpty(property.getValue()) && PropertyNames.NETWORK_ROLE.getPropertyName().equalsIgnoreCase(property.getName()) && ComponentTypeEnum.SERVICE == componentTypeEnum) { - ComponentParametersView componentParametersView = new ComponentParametersView(); - componentParametersView.disableAll(); - componentParametersView.setIgnoreComponentInstances(false); - Either getServiceResult = toscaOperationFacade.getToscaElement(componentId, componentParametersView); - if (getServiceResult.isRight()) { - return getServiceResult.right().value(); + return concatServiceNameToVLINetworkRolePropertiesValues(toscaOperationFacade, componentTypeEnum, componentId, resourceInstanceId, Arrays.asList(property)); + } + + // US833308 VLI in service - specific network_role property value logic + private StorageOperationStatus concatServiceNameToVLINetworkRolePropertiesValues(ToscaOperationFacade toscaOperationFacade, ComponentTypeEnum componentTypeEnum, String componentId, String resourceInstanceId, List properties) { + for (ComponentInstanceProperty property: properties) { + if (isNetworkRoleServiceProperty(property, componentTypeEnum)) { + ComponentParametersView componentParametersView = new ComponentParametersView(); + componentParametersView.disableAll(); + componentParametersView.setIgnoreComponentInstances(false); + Either getServiceResult = toscaOperationFacade.getToscaElement(componentId, componentParametersView); + if (getServiceResult.isRight()) { + return getServiceResult.right().value(); + } + Component service = getServiceResult.left().value(); + Optional getInstance = service.getComponentInstances().stream().filter(p -> p.getUniqueId().equals(resourceInstanceId)).findAny(); + if (!getInstance.isPresent()) { + return StorageOperationStatus.NOT_FOUND; + } + String prefix = service.getSystemName() + "."; + String value = property.getValue(); + if (OriginTypeEnum.VL == getInstance.get().getOriginType() && (!value.startsWith(prefix) || value.equalsIgnoreCase(prefix))) { + property.setValue(prefix + value); + } + } + } + return StorageOperationStatus.OK; + } + + private Either updatePropertyObjectValue(ComponentInstanceProperty property, Map allDataTypes) { + String innerType = null; + String propertyType = property.getType(); + ToscaPropertyType type = ToscaPropertyType.isValidType(propertyType); + log.debug("The type of the property {} is {}", property.getUniqueId(), propertyType); + + if (type == ToscaPropertyType.LIST || type == ToscaPropertyType.MAP) { + SchemaDefinition def = property.getSchema(); + if (def == null) { + log.debug("Schema doesn't exists for property of type {}", type); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(StorageOperationStatus.INVALID_VALUE))); } - Component service = getServiceResult.left().value(); - Optional getInstance = service.getComponentInstances().stream().filter(p -> p.getUniqueId().equals(resourceInstanceId)).findAny(); - if (!getInstance.isPresent()) { - return StorageOperationStatus.NOT_FOUND; + PropertyDataDefinition propDef = def.getProperty(); + if (propDef == null) { + log.debug("Property in Schema Definition inside property of type {} doesn't exist", type); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(StorageOperationStatus.INVALID_VALUE))); } - String prefix = service.getSystemName() + "."; - String value = property.getValue(); - if (OriginTypeEnum.VL == getInstance.get().getOriginType() && (!value.startsWith(prefix) || value.equalsIgnoreCase(prefix))) { - property.setValue(prefix + value); + innerType = propDef.getType(); + } + // Specific Update Logic + Either isValid = propertyOperation.validateAndUpdatePropertyValue(propertyType, property.getValue(), true, innerType, allDataTypes); + String newValue = property.getValue(); + if (isValid.isRight()) { + Boolean res = isValid.right().value(); + if (res == false) { + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.ILLEGAL_ARGUMENT)))); + } + } else { + Object object = isValid.left().value(); + if (object != null) { + newValue = object.toString(); } } - return StorageOperationStatus.OK; + + ImmutablePair pair = propertyOperation.validateAndUpdateRules(propertyType, property.getRules(), innerType, allDataTypes, true); + if (pair.getRight() != null && pair.getRight() == false) { + BeEcompErrorManager.getInstance().logBeInvalidValueError("Add property value", pair.getLeft(), property.getName(), propertyType); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.ILLEGAL_ARGUMENT)))); + } + return Either.left(newValue); } public Either createOrUpdatePropertyValue(ComponentTypeEnum componentTypeEnum, String componentId, String resourceInstanceId, ComponentInstanceProperty property, String userId) { @@ -1156,7 +1411,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { if (object != null) { newValue = object.toString(); } - } + } ImmutablePair pair = propertyOperation.validateAndUpdateRules(propertyType, property.getRules(), innerType, allDataTypes.left().value(), true); if (pair.getRight() != null && pair.getRight() == false) { @@ -1169,12 +1424,12 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { Optional instanceProperty = instanceProperties.stream().filter(p -> p.getUniqueId().equals(property.getUniqueId())).findAny(); StorageOperationStatus status; instanceProperty.get().setValue(newValue); - if(instanceProperty.isPresent()){ + if (instanceProperty.isPresent()) { status = toscaOperationFacade.updateComponentInstanceProperty(containerComponent, foundResourceInstance.getUniqueId(), property); } else { status = toscaOperationFacade.addComponentInstanceProperty(containerComponent, foundResourceInstance.getUniqueId(), property); } - if(status != StorageOperationStatus.OK){ + if (status != StorageOperationStatus.OK) { ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(status); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, "")); return resultOp; @@ -1182,17 +1437,17 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { List path = new ArrayList<>(); path.add(foundResourceInstance.getUniqueId()); property.setPath(path); - + foundResourceInstance.setCustomizationUUID(UUID.randomUUID().toString()); Either updateContainerRes = toscaOperationFacade.updateComponentInstanceMetadataOfTopologyTemplate(containerComponent); - + if (updateContainerRes.isRight()) { ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(updateContainerRes.right().value()); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, "")); return resultOp; } - resultOp = Either.left(property); - return resultOp; + resultOp = Either.left(property); + return resultOp; } finally { if (resultOp == null || resultOp.isRight()) { @@ -1205,7 +1460,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } } - + public Either createOrUpdateInstanceInputValue(ComponentTypeEnum componentTypeEnum, String componentId, String resourceInstanceId, ComponentInstanceInput property, String userId) { Either resultOp = null; @@ -1239,9 +1494,9 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE, resourceInstanceId, componentId)); return resultOp; } - + ComponentInstance foundResourceInstance = resourceInstanceStatus.left().value(); - + // lock resource StorageOperationStatus lockStatus = graphLockOperation.lockComponent(componentId, componentTypeEnum.getNodeType()); if (lockStatus != StorageOperationStatus.OK) { @@ -1276,44 +1531,38 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } Either isValid = propertyOperation.validateAndUpdatePropertyValue(propertyType, property.getValue(), true, innerType, allDataTypes.left().value()); - String newValue = property.getValue(); if (isValid.isRight()) { Boolean res = isValid.right().value(); - if (res == false) { + if (!res) { return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.ILLEGAL_ARGUMENT)))); } - } else { - Object object = isValid.left().value(); - if (object != null) { - newValue = object.toString(); - } - } + } try { List instanceProperties = containerComponent.getComponentInstancesInputs().get(resourceInstanceId); Optional instanceProperty = instanceProperties.stream().filter(p -> p.getUniqueId().equals(property.getUniqueId())).findAny(); StorageOperationStatus status; - if(instanceProperty.isPresent()){ + if (instanceProperty.isPresent()) { instanceProperty.get().setValue(property.getValue()); status = toscaOperationFacade.updateComponentInstanceInput(containerComponent, foundResourceInstance.getUniqueId(), property); } else { status = toscaOperationFacade.addComponentInstanceInput(containerComponent, foundResourceInstance.getUniqueId(), property); } - if(status != StorageOperationStatus.OK){ + if (status != StorageOperationStatus.OK) { ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(status); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, "")); return resultOp; } foundResourceInstance.setCustomizationUUID(UUID.randomUUID().toString()); Either updateContainerRes = toscaOperationFacade.updateComponentInstanceMetadataOfTopologyTemplate(containerComponent); - + if (updateContainerRes.isRight()) { ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(updateContainerRes.right().value()); resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, "")); return resultOp; } - resultOp = Either.left(property); - return resultOp; + resultOp = Either.left(property); + return resultOp; } finally { if (resultOp == null || resultOp.isRight()) { @@ -1577,7 +1826,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } private Either getAndValidateOriginComponentOfComponentInstance(ComponentTypeEnum containerComponentType, ComponentInstance componentInstance) { - + Either eitherResponse = null; ComponentTypeEnum componentType = getComponentTypeByParentComponentType(containerComponentType); Component component; @@ -1589,16 +1838,16 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { errorResponse = componentsUtils.getResponseFormat(actionStatus, Constants.EMPTY_STRING); eitherResponse = Either.right(errorResponse); } - if(eitherResponse == null) { + if (eitherResponse == null) { component = getComponentRes.left().value(); LifecycleStateEnum resourceCurrState = component.getLifecycleState(); if (resourceCurrState == LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT) { ActionStatus actionStatus = ActionStatus.ILLEGAL_COMPONENT_STATE; errorResponse = componentsUtils.getResponseFormat(actionStatus, component.getComponentType().toString(), component.getName(), resourceCurrState.toString()); - eitherResponse = Either.right(errorResponse); + eitherResponse = Either.right(errorResponse); } } - if(eitherResponse == null) { + if (eitherResponse == null) { eitherResponse = Either.left(getComponentRes.left().value()); } return eitherResponse; @@ -1632,7 +1881,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { return Either.right(validateCanWorkOnComponent.right().value()); } - Either resourceInstanceStatus = getResourceInstanceById(containerComponent,componentInstanceId); + Either resourceInstanceStatus = getResourceInstanceById(containerComponent, componentInstanceId); if (resourceInstanceStatus.isRight()) { resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE, componentInstanceId, containerComponentId)); return resultOp; @@ -1646,48 +1895,79 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } try { + + if (currentResourceInstance.getComponentUid().equals(newComponentInstance.getComponentUid())) { resultOp = Either.left(currentResourceInstance); return resultOp; } String resourceId = newComponentInstance.getComponentUid(); + + + Either componentExistsRes = toscaOperationFacade.validateComponentExists(resourceId); - if(componentExistsRes.isRight()){ + if (componentExistsRes.isRight()) { log.debug("Failed to validate existing of the component {}. Status is {} ", resourceId); resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(componentExistsRes.right().value()), resourceId)); return resultOp; - } - else if (!componentExistsRes.left().value()) { + } else if (!componentExistsRes.left().value()) { log.debug("The resource {} not found ", resourceId); resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_NOT_FOUND, resourceId)); return resultOp; } - // List groupInstances = currentResourceInstance.getGroupInstances(); - Map deploymentArtifacts = currentResourceInstance.getDeploymentArtifacts(); + Either eitherOriginComponent = getOriginComponentFromComponentInstance(currentResourceInstance, true); + + if (eitherOriginComponent.isRight()) { + resultOp = Either.right(eitherOriginComponent.right().value()); + return resultOp; + } + DataForMergeHolder dataHolder = compInstMergeDataBL.saveAllDataBeforeDeleting(containerComponent, currentResourceInstance, eitherOriginComponent.left().value()); resultOp = deleteComponentInstance(containerComponent, componentInstanceId, containerComponentType); if (resultOp.isRight()) { log.debug("failed to delete resource instance {}", resourceId); return resultOp; } + ComponentInstance resResourceInfo = resultOp.left().value(); + Component origComponent = null; + OriginTypeEnum originType = currentResourceInstance.getOriginType(); + if (originType == OriginTypeEnum.ServiceProxy) { + Either serviceProxyOrigin = toscaOperationFacade.getLatestByName("serviceProxy"); + if (serviceProxyOrigin.isRight()) { + log.debug("Failed to fetch normative service proxy resource by tosca name, error {}", serviceProxyOrigin.right().value()); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(serviceProxyOrigin.right().value()))); + } + origComponent = serviceProxyOrigin.left().value(); - Either eitherResourceName = getOriginComponentNameFromComponentInstance(newComponentInstance, true); + StorageOperationStatus fillProxyRes = fillProxyInstanceData(newComponentInstance, origComponent); - if (eitherResourceName.isRight()) { - resultOp = Either.right(eitherResourceName.right().value()); - return resultOp; - } + if (fillProxyRes != StorageOperationStatus.OK) { + log.debug("Failed to fill service proxy resource data with data from service, error {}", fillProxyRes); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(fillProxyRes))); - Component origComponent = eitherResourceName.left().value(); + } + newComponentInstance.setOriginType(originType); + }else{ + + + Either eitherResourceName = getOriginComponentFromComponentInstance(newComponentInstance, true); + + if (eitherResourceName.isRight()) { + resultOp = Either.right(eitherResourceName.right().value()); + return resultOp; + } + + origComponent = eitherResourceName.left().value(); + + newComponentInstance.setName(resResourceInfo.getName()); + //newComponentInstance.setToscaComponentName(((ResourceMetadataDataDefinition) origComponent.getComponentMetadataDefinition().getMetadataDataDefinition()).getToscaResourceName()); + } - ComponentInstance resResourceInfo = resultOp.left().value(); - newComponentInstance.setName(resResourceInfo.getName()); newComponentInstance.setInvariantName(resResourceInfo.getInvariantName()); newComponentInstance.setPosX(resResourceInfo.getPosX()); newComponentInstance.setPosY(resResourceInfo.getPosY()); newComponentInstance.setDescription(resResourceInfo.getDescription()); - newComponentInstance.setToscaComponentName(((ResourceMetadataDataDefinition)origComponent.getComponentMetadataDefinition().getMetadataDataDefinition()).getToscaResourceName()); resultOp = createComponentInstanceOnGraph(containerComponent, origComponent, newComponentInstance, user); @@ -1702,29 +1982,25 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { return resultOp; } - /* if (CollectionUtils.isNotEmpty(groupInstances)) { - StorageOperationStatus addGroupsToComponentInstance = toscaOperationFacade.addGroupInstancesToComponentInstance(containerComponent, updatedComponentInstance, groupInstances); - if (addGroupsToComponentInstance != StorageOperationStatus.OK) { - BeEcompErrorManager.getInstance().logInternalFlowError("ChangeComponentInstanceVersion", "Failed to associate groups to new component instance", ErrorSeverity.ERROR); - resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); - return resultOp; - } - - + Either mergeStatusEither = compInstMergeDataBL.mergeComponentUserOrigData(user, dataHolder, containerComponent, containerComponentId, newComponentInstance.getUniqueId()); + if (mergeStatusEither.isRight()) { + return Either.right(mergeStatusEither.right().value()); } - if (MapUtils.isNotEmpty(deploymentArtifacts)) { - StorageOperationStatus addDeploymentArtifactsToComponentInstance = toscaOperationFacade.addDeploymentArtifactsToComponentInstance(containerComponent, updatedComponentInstance, deploymentArtifacts); - if (addDeploymentArtifactsToComponentInstance != StorageOperationStatus.OK) { - BeEcompErrorManager.getInstance().logInternalFlowError("ChangeComponentInstanceVersion", "Failed to associate groups to new component instance", ErrorSeverity.ERROR); - resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); - return resultOp; - } - }*/ - + /* + * if (CollectionUtils.isNotEmpty(groupInstances)) { StorageOperationStatus addGroupsToComponentInstance = toscaOperationFacade.addGroupInstancesToComponentInstance( containerComponent, updatedComponentInstance, groupInstances); if + * (addGroupsToComponentInstance != StorageOperationStatus.OK) { BeEcompErrorManager.getInstance().logInternalFlowError( "ChangeComponentInstanceVersion", "Failed to associate groups to new component instance", ErrorSeverity.ERROR); + * resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus. GENERAL_ERROR)); return resultOp; } + * + * + * } if (MapUtils.isNotEmpty(deploymentArtifacts)) { StorageOperationStatus addDeploymentArtifactsToComponentInstance = toscaOperationFacade.addDeploymentArtifactsToComponentInstance( containerComponent, updatedComponentInstance, + * deploymentArtifacts); if (addDeploymentArtifactsToComponentInstance != StorageOperationStatus.OK) { BeEcompErrorManager.getInstance().logInternalFlowError( "ChangeComponentInstanceVersion", + * "Failed to associate groups to new component instance", ErrorSeverity.ERROR); resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus. GENERAL_ERROR)); return resultOp; } } + */ + ComponentParametersView filter = new ComponentParametersView(true); filter.setIgnoreComponentInstances(false); - Either updatedComponentRes = toscaOperationFacade.getToscaElement(containerComponentId, filter); + Either updatedComponentRes = toscaOperationFacade.getToscaElement(containerComponentId, filter); if (updatedComponentRes.isRight()) { StorageOperationStatus storageOperationStatus = updatedComponentRes.right().value(); ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(storageOperationStatus, containerComponent.getComponentType()); @@ -1732,7 +2008,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { log.debug("Component with id {} was not found", containerComponentId); return Either.right(responseFormat); } - resourceInstanceStatus = getResourceInstanceById(updatedComponentRes.left().value(),updatedComponentInstance.getUniqueId()); + resourceInstanceStatus = getResourceInstanceById(updatedComponentRes.left().value(), updatedComponentInstance.getUniqueId()); if (resourceInstanceStatus.isRight()) { resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(resourceInstanceStatus.right().value()), updatedComponentInstance.getUniqueId())); return resultOp; @@ -1780,9 +2056,9 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE, componentInstanceUniqueId, containerComponentId)); return resultOp; } - + List instanceProperties = containerComponent.getComponentInstancesProperties().get(componentInstanceUniqueId); - if(CollectionUtils.isEmpty(instanceProperties)){ + if (CollectionUtils.isEmpty(instanceProperties)) { instanceProperties = new ArrayList<>(); } resultOp = Either.left(instanceProperties); @@ -1808,7 +2084,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { /** * updates componentInstance modificationTime - * + * * @param componentInstance * @param componentInstanceType * @param modificationTime @@ -1827,7 +2103,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } return result; } - + public Either deleteServiceProxy(String containerComponentType, String containerComponentId, String serviceProxyId, String userId) { // TODO Add implementation Either result = Either.left(new ComponentInstance()); @@ -1845,7 +2121,7 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { Either result = Either.left(new ComponentInstance()); return result; } - + private Boolean validateInstanceNameUniquenessUponUpdate(Component containerComponent, ComponentInstance oldComponentInstance, String newInstanceName) { Boolean isUnique = true; String newInstanceNormalizedName = ValidationUtils.normalizeComponentInstanceName(newInstanceName); @@ -1859,57 +2135,259 @@ public abstract class ComponentInstanceBusinessLogic extends BaseBusinessLogic { } private Either getResourceInstanceById(Component containerComponent, String instanceId) { - + Either result = null; List instances = containerComponent.getComponentInstances(); Optional foundInstance = null; - if(CollectionUtils.isEmpty(instances)){ + if (CollectionUtils.isEmpty(instances)) { result = Either.right(StorageOperationStatus.NOT_FOUND); } - if(result == null){ + if (result == null) { foundInstance = instances.stream().filter(i -> i.getUniqueId().equals(instanceId)).findFirst(); - if(!foundInstance.isPresent()){ + if (!foundInstance.isPresent()) { result = Either.right(StorageOperationStatus.NOT_FOUND); } } - if(result == null){ + if (result == null) { result = Either.left(foundInstance.get()); } return result; } - - private ComponentInstance buildComponentInstance(ComponentInstance resourceInstanceForUpdate, ComponentInstance origInstanceForUpdate) { - Long creationDate = origInstanceForUpdate.getCreationTime(); - + private ComponentInstance buildComponentInstance(ComponentInstance resourceInstanceForUpdate, ComponentInstance origInstanceForUpdate) { + + Long creationDate = origInstanceForUpdate.getCreationTime(); + Long modificationTime = System.currentTimeMillis(); resourceInstanceForUpdate.setCreationTime(creationDate); resourceInstanceForUpdate.setModificationTime(modificationTime); - + resourceInstanceForUpdate.setCustomizationUUID(origInstanceForUpdate.getCustomizationUUID()); - + if (StringUtils.isEmpty(resourceInstanceForUpdate.getName()) && StringUtils.isNotEmpty(origInstanceForUpdate.getName())) { resourceInstanceForUpdate.setName(origInstanceForUpdate.getName()); } - + resourceInstanceForUpdate.setNormalizedName(ValidationUtils.normalizeComponentInstanceName(resourceInstanceForUpdate.getName())); - + if (StringUtils.isEmpty(resourceInstanceForUpdate.getIcon())) - resourceInstanceForUpdate.setIcon(origInstanceForUpdate.getIcon()); - - + resourceInstanceForUpdate.setIcon(origInstanceForUpdate.getIcon()); + if (StringUtils.isEmpty(resourceInstanceForUpdate.getComponentVersion())) resourceInstanceForUpdate.setComponentVersion(origInstanceForUpdate.getComponentVersion()); - + if (StringUtils.isEmpty(resourceInstanceForUpdate.getComponentName())) resourceInstanceForUpdate.setComponentName(origInstanceForUpdate.getComponentName()); - + if (StringUtils.isEmpty(resourceInstanceForUpdate.getToscaComponentName())) - resourceInstanceForUpdate.setToscaComponentName(origInstanceForUpdate.getToscaComponentName()); - - if (resourceInstanceForUpdate.getOriginType() == null) { + resourceInstanceForUpdate.setToscaComponentName(origInstanceForUpdate.getToscaComponentName()); + + if (resourceInstanceForUpdate.getOriginType() == null) { resourceInstanceForUpdate.setOriginType(origInstanceForUpdate.getOriginType()); } + if(resourceInstanceForUpdate.getOriginType() == OriginTypeEnum.ServiceProxy) + resourceInstanceForUpdate.setIsProxy(true); + if (resourceInstanceForUpdate.getSourceModelInvariant() == null) { + resourceInstanceForUpdate.setSourceModelInvariant(origInstanceForUpdate.getSourceModelInvariant()); + } + if (resourceInstanceForUpdate.getSourceModelName() == null) { + resourceInstanceForUpdate.setSourceModelName(origInstanceForUpdate.getSourceModelName()); + } + if (resourceInstanceForUpdate.getSourceModelUuid() == null) { + resourceInstanceForUpdate.setSourceModelUuid(origInstanceForUpdate.getSourceModelUuid()); + } + if (resourceInstanceForUpdate.getSourceModelUid() == null) { + resourceInstanceForUpdate.setSourceModelUid(origInstanceForUpdate.getSourceModelUid()); + } return resourceInstanceForUpdate; } + /** + * Returns list of ComponentInstanceProperty belonging to component instance capability specified by name and type + * @param containerComponentType + * @param containerComponentId + * @param componentInstanceUniqueId + * @param capabilityType + * @param capabilityName + * @param userId + * @return + */ + public Either, ResponseFormat> getComponentInstanceCapabilityPropertiesById(String containerComponentType, String containerComponentId, String componentInstanceUniqueId, String capabilityType, String capabilityName, String userId) { + + Component containerComponent = null; + + Either, ResponseFormat> resultOp = null; + try { + Either validateUserExists = validateUserExists(userId, "Get Component Instance Properties By Id", false); + if (validateUserExists.isRight()) { + resultOp = Either.right(validateUserExists.right().value()); + } + if(resultOp == null){ + Either validateComponentType = validateComponentType(containerComponentType); + if (validateComponentType.isRight()) { + resultOp = Either.right(validateComponentType.right().value()); + } + } + if(resultOp == null){ + Either validateContainerComponentExists = toscaOperationFacade.getToscaFullElement(containerComponentId); + if (validateContainerComponentExists.isRight()) { + resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(validateContainerComponentExists.right().value()))); + } else { + containerComponent = validateContainerComponentExists.left().value(); + } + } + if(resultOp == null){ + Either resourceInstanceStatus = getResourceInstanceById(containerComponent, componentInstanceUniqueId); + if (resourceInstanceStatus.isRight()) { + resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE, componentInstanceUniqueId, containerComponentId)); + } else { + resultOp = findCapabilityOfInstance(containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, resourceInstanceStatus.left().value().getCapabilities()); + } + } + return resultOp; + } finally { + unlockComponent(resultOp, containerComponent); + } + } + + private Either, ResponseFormat> findCapabilityOfInstance( String componentId, String instanceId, String capabilityType, String capabilityName, Map> instanceCapabilities) { + Either, ResponseFormat> result = null; + CapabilityDefinition foundCapability; + if (MapUtils.isNotEmpty(instanceCapabilities)) { + List capabilitiesPerType = instanceCapabilities.get(capabilityType); + if (capabilitiesPerType != null) { + Optional capabilityOpt = capabilitiesPerType.stream().filter(c -> c.getName().equals(capabilityName)).findFirst(); + if (capabilityOpt.isPresent()) { + foundCapability = capabilityOpt.get(); + result = Either.left(foundCapability.getProperties() == null ? new ArrayList<>() : foundCapability.getProperties()); + } + } + } + if (result == null) { + result = fetchComponentInstanceCapabilityProperties(componentId, instanceId, capabilityType, capabilityName); + } + return result; + } + + private Either, ResponseFormat> fetchComponentInstanceCapabilityProperties(String componentId, String instanceId, String capabilityType, String capabilityName) { + Either, ResponseFormat> resultOp = null; + try { + Either, StorageOperationStatus> getComponentInstanceCapabilityProperties = toscaOperationFacade.getComponentInstanceCapabilityProperties(componentId, instanceId, capabilityName, capabilityType); + if(getComponentInstanceCapabilityProperties.isRight()){ + resultOp = Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(getComponentInstanceCapabilityProperties.right().value()), capabilityType, instanceId, componentId)); + } else { + resultOp = Either.left(getComponentInstanceCapabilityProperties.left().value()); + } + } catch(Exception e){ + log.error("The exception {} occurred upon the component {} instance {} capability {} properties retrieving. ", componentId, instanceId, capabilityName, e); + resultOp = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + return resultOp; + } + + private ResponseFormat updateCapabilityPropertyOnContainerComponent(ComponentInstanceProperty property, String newValue, Component containerComponent, ComponentInstance foundResourceInstance, + String capabilityType, String capabilityName) { + String componentInstanceUniqueId = foundResourceInstance.getUniqueId(); + StringBuilder sb = new StringBuilder(componentInstanceUniqueId); + sb.append(ModelConverter.CAP_PROP_DELIM).append(property.getOwnerId()).append(ModelConverter.CAP_PROP_DELIM).append(capabilityType).append(ModelConverter.CAP_PROP_DELIM).append(capabilityName); + String capKey = sb.toString(); + + Map> capabilities = Optional.ofNullable(foundResourceInstance.getCapabilities()) + .orElse(Collections.emptyMap()); + List capPerType = Optional.ofNullable(capabilities.get(capabilityType)).orElse(Collections.emptyList()); + Optional cap = capPerType.stream().filter(c -> c.getName().equals(capabilityName)).findAny(); + if (cap.isPresent()) { + List capProperties = cap.get().getProperties(); + if (capProperties != null) { + Optional instanceProperty = capProperties.stream().filter(p -> p.getUniqueId().equals(property.getUniqueId())).findAny(); + StorageOperationStatus status; + if (instanceProperty.isPresent()) { + instanceProperty.get().setValue(newValue); + List path = new ArrayList<>(); + path.add(componentInstanceUniqueId); + path.add(capKey); + instanceProperty.get().setPath(path); + status = toscaOperationFacade.updateComponentInstanceCapabiltyProperty(containerComponent, componentInstanceUniqueId, capKey, instanceProperty.get()); + if (status != StorageOperationStatus.OK) { + ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(status); + return componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, ""); + + } + foundResourceInstance.setCustomizationUUID(UUID.randomUUID().toString()); + } + } + } + return componentsUtils.getResponseFormat(ActionStatus.OK); + } + + public Either, ResponseFormat> updateInstanceCapabilityProperties(ComponentTypeEnum componentTypeEnum, String containerComponentId, String componentInstanceUniqueId, String capabilityType, String capabilityName, + List properties, String userId) { + Either, ResponseFormat> resultOp = null; + + Either resp = validateUserExists(userId, "update instance capability property", false); + if (resp.isRight()) { + return Either.right(resp.right().value()); + } + + if (componentTypeEnum == null) { + BeEcompErrorManager.getInstance().logInvalidInputError("updateInstanceCapabilityProperty", "invalid component type", ErrorSeverity.INFO); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.NOT_ALLOWED)); + } + Either getResourceResult = toscaOperationFacade.getToscaFullElement(containerComponentId); + + if (getResourceResult.isRight()) { + log.debug("Failed to retrieve component, component id {}", containerComponentId); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.RESTRICTED_OPERATION)); + } + Component containerComponent = getResourceResult.left().value(); + + if (!ComponentValidationUtils.canWorkOnComponent(containerComponent, userId)) { + log.info("Restricted operation for user: {} on component {}", userId, containerComponentId); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.RESTRICTED_OPERATION)); + } + Either resourceInstanceStatus = getResourceInstanceById(containerComponent, componentInstanceUniqueId); + if (resourceInstanceStatus.isRight()) { + return Either.right(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE, componentInstanceUniqueId, containerComponentId)); + } + ComponentInstance foundResourceInstance = resourceInstanceStatus.left().value(); + // lock resource + StorageOperationStatus lockStatus = graphLockOperation.lockComponent(containerComponentId, componentTypeEnum.getNodeType()); + if (lockStatus != StorageOperationStatus.OK) { + log.debug("Failed to lock component {}", containerComponentId); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(lockStatus))); + } + + Either, TitanOperationStatus> allDataTypes = dataTypeCache.getAll(); + if (allDataTypes.isRight()) { + TitanOperationStatus status = allDataTypes.right().value(); + BeEcompErrorManager.getInstance().logInternalFlowError("UpdatePropertyValueOnComponentInstance", "Failed to update property value on instance. Status is " + status, ErrorSeverity.ERROR); + return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(DaoStatusConverter.convertTitanStatusToStorageStatus(status)))); + } + + try { + for (ComponentInstanceProperty property : properties) { + Either newPropertyValueEither = updatePropertyObjectValue(property, allDataTypes.left().value()); + newPropertyValueEither.bimap(updatedValue -> + updateCapabilityPropertyOnContainerComponent(property,updatedValue, containerComponent, foundResourceInstance, capabilityType, capabilityName), + responseFormat -> Either.right(responseFormat)); + } + Either updateContainerRes = toscaOperationFacade.updateComponentInstanceMetadataOfTopologyTemplate(containerComponent); + + if (updateContainerRes.isRight()) { + ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(updateContainerRes.right().value()); + resultOp = Either.right(componentsUtils.getResponseFormatForResourceInstanceProperty(actionStatus, "")); + return resultOp; + } + resultOp = Either.left(properties); + return resultOp; + + } finally { + if (resultOp == null || resultOp.isRight()) { + titanDao.rollback(); + } else { + titanDao.commit(); + } + // unlock resource + graphLockOperation.unlockComponent(containerComponentId, componentTypeEnum.getNodeType()); + } + } } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogic.java index e8c04c22c1..f6a108cf75 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogic.java @@ -69,7 +69,7 @@ public class CompositionBusinessLogic { boolean isNotAllPositionsCalculated = resource.getComponentInstances() == null || resource.getComponentInstances().stream().filter(p -> (p.getPosX() == null || p.getPosX().isEmpty()) || (p.getPosY() == null || p.getPosY().isEmpty())).findAny().isPresent(); - if (isNotAllPositionsCalculated) { + if (isNotAllPositionsCalculated && resource.getComponentInstances() != null) { // Arrange Icons In Spiral Pattern Map, ComponentInstance> componentInstanceLocations = buildSpiralPatternPositioningForComponentInstances(resource); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java index 8b0c6fa8bf..53dceb8112 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.be.components.impl; -import static org.openecomp.sdc.be.tosca.CsarUtils.VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.StringReader; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DistributionMonitoringBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DistributionMonitoringBusinessLogic.java index 9d9425ea85..be3ac13cc9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DistributionMonitoringBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/DistributionMonitoringBusinessLogic.java @@ -20,9 +20,12 @@ package org.openecomp.sdc.be.components.impl; -import org.springframework.beans.factory.annotation.Autowired; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; -import fj.data.Either; import org.apache.http.HttpStatus; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao; @@ -43,7 +46,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.*; +import fj.data.Either; @Component("distributionMonitoringBusinessLogic") public class DistributionMonitoringBusinessLogic extends BaseBusinessLogic { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java index 2c051b2b94..54bed5ae56 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java @@ -20,10 +20,20 @@ package org.openecomp.sdc.be.components.impl; -import com.thinkaurelius.titan.core.TitanGraph; -import fj.data.Either; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.function.Predicate; +import java.util.stream.Collectors; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URLEncodedUtils; @@ -38,10 +48,27 @@ import org.openecomp.sdc.be.datamodel.api.CategoryTypeEnum; import org.openecomp.sdc.be.datamodel.utils.NodeTypeConvertUtils; import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.*; +import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ComponentFieldsEnum; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.ArtifactType; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.DistributionStatusEnum; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.Product; +import org.openecomp.sdc.be.model.PropertyScope; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.ResourceMetadataDefinition; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.Tag; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.GroupingDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; @@ -64,10 +91,9 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.function.Predicate; -import java.util.stream.Collectors; +import com.thinkaurelius.titan.core.TitanGraph; + +import fj.data.Either; @org.springframework.stereotype.Component("elementsBusinessLogic") public class ElementBusinessLogic extends BaseBusinessLogic { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogic.java index a3d590374f..de571b0f03 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogic.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.components.impl; -import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -42,17 +41,13 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.codehaus.jackson.JsonGenerationException; -import org.codehaus.jackson.map.JsonMappingException; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.jsongraph.utils.JsonParserUtils; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.info.ArtifactDefinitionInfo; import org.openecomp.sdc.be.info.ArtifactTemplateInfo; import org.openecomp.sdc.be.info.GroupDefinitionInfo; @@ -69,17 +64,15 @@ import org.openecomp.sdc.be.model.GroupTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.PropertyDefinition.GroupInstancePropertyValueUpdateBehavior; import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; -import org.openecomp.sdc.be.model.operations.impl.GroupOperation; import org.openecomp.sdc.be.model.operations.impl.GroupTypeOperation; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; -import org.openecomp.sdc.common.api.ArtifactTypeEnum; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; @@ -88,7 +81,6 @@ import org.springframework.beans.factory.annotation.Autowired; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonSyntaxException; import fj.data.Either; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeImportManager.java index 2de9eee217..b3448b27ef 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeImportManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GroupTypeImportManager.java @@ -20,7 +20,15 @@ package org.openecomp.sdc.be.components.impl; -import fj.data.Either; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.components.impl.CommonImportManager.ElementTypeEnum; import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum; @@ -37,13 +45,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; +import fj.data.Either; @Component("groupTypeImportManager") public class GroupTypeImportManager { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/HealthCheckBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/HealthCheckBusinessLogic.java index fe9c8488aa..eff3d39f7f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/HealthCheckBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/HealthCheckBusinessLogic.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.components.impl; import java.io.IOException; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -38,6 +37,8 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; import org.apache.http.HttpEntity; import org.apache.http.HttpStatus; import org.apache.http.client.config.RequestConfig; @@ -54,18 +55,18 @@ import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.IEsHealthCheckDao; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.switchover.detector.SwitchoverDetector; +import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; -import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.util.HealthCheckUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; @Component("healthCheckBusinessLogic") public class HealthCheckBusinessLogic { @@ -135,12 +136,26 @@ public class HealthCheckBusinessLogic { return true; } - public List getBeHealthCheckInfosStatus() { + public Pair> getBeHealthCheckInfosStatus() { - return prevBeHealthCheckInfos; + return new ImmutablePair>(getAggregateBeStatus(prevBeHealthCheckInfos), prevBeHealthCheckInfos); } + private Boolean getAggregateBeStatus(List beHealthCheckInfos) { + + Boolean status = true; + + for (HealthCheckInfo healthCheckInfo : beHealthCheckInfos) { + if (healthCheckInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN) && !healthCheckInfo.getHealthCheckComponent().equals(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE)) { + status = false; + break; + } + } + return status; + } + + private List getBeHealthCheckInfos() { log.trace("In getBeHealthCheckInfos"); @@ -150,9 +165,6 @@ public class HealthCheckBusinessLogic { // BE getBeHealthCheck(healthCheckInfos); - /*// ES - getEsHealthCheck(healthCheckInfos);*/ - // Titan getTitanHealthCheck(healthCheckInfos); @@ -165,18 +177,21 @@ public class HealthCheckBusinessLogic { // Amdocs getAmdocsHealthCheck(healthCheckInfos); + //DCAE + getDcaeHealthCheck(healthCheckInfos); + return healthCheckInfos; } private List getBeHealthCheck(List healthCheckInfos) { String appVersion = ExternalConfiguration.getAppVersion(); String description = "OK"; - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.BE, HealthCheckStatus.UP, appVersion, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.UP, appVersion, description)); return healthCheckInfos; } //Removed from aggregate HC - TDP 293490 -/* private List getEsHealthCheck(List healthCheckInfos) { + /* private List getEsHealthCheck(List healthCheckInfos) { // ES health check and version HealthCheckStatus healthCheckStatus; @@ -198,7 +213,7 @@ public class HealthCheckBusinessLogic { healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.ES, healthCheckStatus, null, description)); return healthCheckInfos; } -*/ + */ public List getTitanHealthCheck(List healthCheckInfos) { // Titan health check and version String description; @@ -208,15 +223,15 @@ public class HealthCheckBusinessLogic { isTitanUp = titanGenericDao.isGraphOpen(); } catch (Exception e) { description = "Titan error: " + e.getMessage(); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.DOWN, null, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.DOWN, null, description)); return healthCheckInfos; } if (isTitanUp) { description = "OK"; - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.UP, null, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.UP, null, description)); } else { description = "Titan graph is down"; - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.DOWN, null, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.DOWN, null, description)); } return healthCheckInfos; } @@ -234,10 +249,10 @@ public class HealthCheckBusinessLogic { } if (isCassandraUp) { description = "OK"; - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.CASSANDRA, HealthCheckStatus.UP, null, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_CASSANDRA, HealthCheckStatus.UP, null, description)); } else { description = "Cassandra is down"; - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.CASSANDRA, HealthCheckStatus.DOWN, null, description)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_CASSANDRA, HealthCheckStatus.DOWN, null, description)); } return healthCheckInfos; @@ -252,71 +267,92 @@ public class HealthCheckBusinessLogic { } private List getAmdocsHealthCheck(List healthCheckInfos) { + HealthCheckInfo beHealthCheckInfo = getHostedComponentsBeHealthCheck(Constants.HC_COMPONENT_ON_BOARDING, buildOnBoardingHealthCheckUrl()); + healthCheckInfos.add(beHealthCheckInfo); + return healthCheckInfos; + } + + private List getDcaeHealthCheck(List healthCheckInfos) { + HealthCheckInfo beHealthCheckInfo = getHostedComponentsBeHealthCheck(Constants.HC_COMPONENT_DCAE, buildDcaeHealthCheckUrl()); + healthCheckInfos.add(beHealthCheckInfo); + return healthCheckInfos; + } + + private HealthCheckInfo getHostedComponentsBeHealthCheck(String componentName, String healthCheckUrl) { HealthCheckStatus healthCheckStatus; String description; String version = null; List componentsInfo = new ArrayList<>(); CloseableHttpClient httpClient = getHttpClient(); - String amdocsHealtchCheckUrl = buildHealthCheckUrl(); - HttpGet httpGet = new HttpGet(amdocsHealtchCheckUrl); - CloseableHttpResponse beResponse; - int beStatus; - try { - beResponse = httpClient.execute(httpGet); - beStatus = beResponse.getStatusLine().getStatusCode(); - - StringBuilder sb = new StringBuilder(); - - if (beStatus == HttpStatus.SC_OK || beStatus == HttpStatus.SC_INTERNAL_SERVER_ERROR) { - HttpEntity entity = beResponse.getEntity(); - String beJsonResponse = EntityUtils.toString(entity); - Gson gson = new Gson(); - HealthCheckWrapper healthCheckWrapper = gson.fromJson(beJsonResponse, HealthCheckWrapper.class); - version = healthCheckWrapper.getSdcVersion(); - componentsInfo = healthCheckWrapper.getComponentsInfo(); - - if (componentsInfo != null) { - componentsInfo.forEach(x -> { - if (x.getHealthCheckStatus() == HealthCheckStatus.DOWN) { - sb.append("Component " + x.getHealthCheckComponent().name() + " is Down, "); - } - }); + + if (healthCheckUrl != null) { + HttpGet httpGet = new HttpGet(healthCheckUrl); + CloseableHttpResponse beResponse; + int beStatus; + try { + beResponse = httpClient.execute(httpGet); + beStatus = beResponse.getStatusLine().getStatusCode(); + + String aggDescription = ""; + + if (beStatus == HttpStatus.SC_OK || beStatus == HttpStatus.SC_INTERNAL_SERVER_ERROR) { + HttpEntity entity = beResponse.getEntity(); + String beJsonResponse = EntityUtils.toString(entity); + log.trace("{} Health Check response: {}", componentName, beJsonResponse); + + ObjectMapper mapper = new ObjectMapper(); + Map healthCheckMap = mapper.readValue(beJsonResponse, new TypeReference>(){}); + version = healthCheckMap.get("sdcVersion") != null ? healthCheckMap.get("sdcVersion").toString() : null; + if (healthCheckMap.containsKey("componentsInfo")) { + componentsInfo = mapper.convertValue(healthCheckMap.get("componentsInfo"), new TypeReference>() {}); + } + + if (componentsInfo.size() > 0) { + aggDescription = HealthCheckUtil.getAggregateDescription(componentsInfo, null); + } else { + componentsInfo.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.DOWN, null, null)); + } } else { - componentsInfo.add(new HealthCheckInfo(HealthCheckComponent.BE, HealthCheckStatus.DOWN, null, null)); + log.trace("{} Health Check Response code: {}", componentName, beStatus); } - } - if (beStatus != HttpStatus.SC_OK) { - healthCheckStatus = HealthCheckStatus.DOWN; - //Removing the last comma - description = sb.length()>0 - ? sb.substring(0, sb.length()-1) - : "Onboarding is Down, specific reason unknown";//No Amdocs inner component returned DOWN, but the status of Amdocs HC is still DOWN. - if (componentsInfo.size() == 0) { - componentsInfo.add(new HealthCheckInfo(HealthCheckComponent.BE, HealthCheckStatus.DOWN, null, description)); + if (beStatus != HttpStatus.SC_OK) { + healthCheckStatus = HealthCheckStatus.DOWN; + description = aggDescription.length() > 0 + ? aggDescription + : componentName + " is Down, specific reason unknown";//No inner component returned DOWN, but the status of HC is still DOWN. + if (componentsInfo.size() == 0) { + componentsInfo.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.DOWN, null, description)); + } + } else { + healthCheckStatus = HealthCheckStatus.UP; + description = "OK"; } - } else { - healthCheckStatus = HealthCheckStatus.UP; - description = "OK"; - } - } catch (Exception e) { - healthCheckStatus = HealthCheckStatus.DOWN; - description = "Onboarding unexpected response: " + e.getMessage(); - componentsInfo.add(new HealthCheckInfo(HealthCheckComponent.BE, HealthCheckStatus.DOWN, null, description)); - } finally { - if (httpClient != null) { - try { - httpClient.close(); - } catch (IOException e) { - e.printStackTrace(); + } catch (Exception e) { + log.error("{} unexpected response: ", componentName, e); + healthCheckStatus = HealthCheckStatus.DOWN; + description = componentName + " unexpected response: " + e.getMessage(); + if (componentsInfo != null && componentsInfo.size() == 0) { + componentsInfo.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.DOWN, null, description)); + } + } finally { + if (httpClient != null) { + try { + httpClient.close(); + } catch (IOException e) { + log.error("closing http client has failed" , e); + } } } + } else { + healthCheckStatus = HealthCheckStatus.DOWN; + description = componentName + " health check Configuration is missing"; + componentsInfo.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.DOWN, null, description)); } - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.ON_BOARDING, healthCheckStatus, version, description, componentsInfo)); - return healthCheckInfos; + return new HealthCheckInfo(componentName, healthCheckStatus, version, description, componentsInfo); } private CloseableHttpClient getHttpClient() { @@ -371,20 +407,6 @@ public class HealthCheckBusinessLogic { } } - - private boolean getAggregateBeStatus(List beHealthCheckInfos) { - - boolean status = true; - - for (HealthCheckInfo healthCheckInfo : beHealthCheckInfos) { - if (healthCheckInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN) && healthCheckInfo.getHealthCheckComponent() != HealthCheckComponent.DE) { - status = false; - break; - } - } - return status; - } - } private void logAlarm(boolean prevHealthState) { @@ -410,8 +432,8 @@ public class HealthCheckBusinessLogic { if (beHealthCheckInfos != null && prevBeHealthCheckInfos != null) { - Map currentValues = beHealthCheckInfos.stream().collect(Collectors.toMap(p -> p.getHealthCheckComponent(), p -> p.getHealthCheckStatus())); - Map prevValues = prevBeHealthCheckInfos.stream().collect(Collectors.toMap(p -> p.getHealthCheckComponent(), p -> p.getHealthCheckStatus())); + Map currentValues = beHealthCheckInfos.stream().collect(Collectors.toMap(p -> p.getHealthCheckComponent(), p -> p.getHealthCheckStatus())); + Map prevValues = prevBeHealthCheckInfos.stream().collect(Collectors.toMap(p -> p.getHealthCheckComponent(), p -> p.getHealthCheckStatus())); if (currentValues != null && prevValues != null) { int currentSize = currentValues.size(); @@ -421,7 +443,7 @@ public class HealthCheckBusinessLogic { result = true; //extra/missing component - Map notPresent = null; + Map notPresent = null; if (currentValues.keySet().containsAll(prevValues.keySet())) { notPresent = new HashMap<>(currentValues); notPresent.keySet().removeAll(prevValues.keySet()); @@ -430,15 +452,15 @@ public class HealthCheckBusinessLogic { notPresent.keySet().removeAll(currentValues.keySet()); } - for (HealthCheckComponent component : notPresent.keySet()) { + for (String component : notPresent.keySet()) { logAlarm(String.format(COMPONENT_CHANGED_MESSAGE, component, prevValues.get(component), currentValues.get(component))); } // HealthCheckComponent changedComponent = notPresent.keySet().iterator().next(); } else { - for (Entry entry : currentValues.entrySet()) { - HealthCheckComponent key = entry.getKey(); + for (Entry entry : currentValues.entrySet()) { + String key = entry.getKey(); HealthCheckStatus value = entry.getValue(); if (!prevValues.containsKey(key)) { @@ -468,15 +490,37 @@ public class HealthCheckBusinessLogic { return result; } - private String buildHealthCheckUrl() { + private String buildOnBoardingHealthCheckUrl() { Configuration.OnboardingConfig onboardingConfig = ConfigurationManager.getConfigurationManager().getConfiguration().getOnboarding(); - String protocol = onboardingConfig.getProtocol(); - String host = onboardingConfig.getHost(); - Integer port = onboardingConfig.getPort(); - String uri = onboardingConfig.getHealthCheckUri(); + if (onboardingConfig != null) { + String protocol = onboardingConfig.getProtocol(); + String host = onboardingConfig.getHost(); + Integer port = onboardingConfig.getPort(); + String uri = onboardingConfig.getHealthCheckUri(); + + return protocol + "://" + host + ":" + port + uri; + } + + log.error("onboarding health check configuration is missing."); + return null; + } + + private String buildDcaeHealthCheckUrl() { + + Configuration.DcaeConfig dcaeConfig = ConfigurationManager.getConfigurationManager().getConfiguration().getDcae(); + + if (dcaeConfig != null) { + String protocol = dcaeConfig.getProtocol(); + String host = dcaeConfig.getHost(); + Integer port = dcaeConfig.getPort(); + String uri = dcaeConfig.getHealthCheckUri(); + + return protocol + "://" + host + ":" + port + uri; + } - return protocol + "://" + host + ":" + port + uri; + log.error("dcae health check configuration is missing."); + return null; } } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ImportUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ImportUtils.java index 1755d0b20c..01d64f519f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ImportUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ImportUtils.java @@ -21,7 +21,15 @@ package org.openecomp.sdc.be.components.impl; import java.lang.reflect.Type; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.function.Consumer; import java.util.function.Function; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InformationDeployedArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InformationDeployedArtifactsBusinessLogic.java index 3b6e0f7a76..52dcce9e2e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InformationDeployedArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InformationDeployedArtifactsBusinessLogic.java @@ -20,31 +20,6 @@ package org.openecomp.sdc.be.components.impl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.apache.commons.codec.binary.Base64; -import org.openecomp.sdc.be.config.ConfigurationManager; -import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig; -import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; -import org.openecomp.sdc.common.api.ArtifactTypeEnum; -import org.openecomp.sdc.common.datastructure.Wrapper; -import org.openecomp.sdc.exception.ResponseFormat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import fj.data.Either; - //Pavel //currently NOT IN USE - there are no informational deployed artifacts after US601880 diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java index 892da8af9d..a9e7f0b34b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java @@ -20,12 +20,19 @@ package org.openecomp.sdc.be.components.impl; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; import java.util.function.BiConsumer; import java.util.stream.Collectors; -import jline.internal.Log; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.json.simple.JSONObject; @@ -50,7 +57,6 @@ import org.openecomp.sdc.be.model.IComponentInstanceConnectedElement; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.User; - import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; @@ -65,6 +71,7 @@ import org.yaml.snakeyaml.Yaml; import com.google.gson.Gson; import fj.data.Either; +import jline.internal.Log; @Component("inputsBusinessLogic") public class InputsBusinessLogic extends BaseBusinessLogic { @@ -311,6 +318,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } currentInput.setDefaultValue(newValue); + currentInput.setOwnerId(userId); Either status = toscaOperationFacade.updateInputOfComponent(component, currentInput); @@ -473,6 +481,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } + assignOwnerIdToInputs(userId, inputsToCreate); Either, StorageOperationStatus> assotiateInputsEither = toscaOperationFacade.addInputsToComponent(inputsToCreate, component.getUniqueId()); if(assotiateInputsEither.isRight()){ @@ -524,6 +533,10 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } + private void assignOwnerIdToInputs(String userId, Map inputsToCreate) { + inputsToCreate.values().forEach(inputDefinition -> inputDefinition.setOwnerId(userId)); + } + private StorageOperationStatus addInputsToComponent(String componentId, Map inputsToCreate, Map> inputsValueToCreateMap, Map allDataTypes, List resList, int index, String compInstId, String compInstname, org.openecomp.sdc.be.model.Component origComponent, InputDefinition input) { @@ -642,7 +655,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } Map inputs = inputsDefinitions.stream().collect(Collectors.toMap( o -> o.getName(), o -> o)); - result = createInputsInGraph(inputs, component, user, inTransaction); + result = createInputsInGraph(inputs, component); } return result; @@ -669,7 +682,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } - public Either, ResponseFormat> createInputsInGraph(Map inputs, org.openecomp.sdc.be.model.Component component, User user, boolean inTransaction) { + public Either, ResponseFormat> createInputsInGraph(Map inputs, org.openecomp.sdc.be.model.Component component) { List resList = inputs.values().stream().collect(Collectors.toList()); Either, ResponseFormat> result = Either.left(resList); @@ -1212,7 +1225,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { propInput.setOwnerId(null); propInput.setParentUniqueId(null); - Either createInputRes = createInputForComponentInstance(component, origComponent,ci, inputsToCreate, propertiesToCreate, inputsValueToCreate, dataTypes, inputName, propInput, isInputValue); + Either createInputRes = createInputForComponentInstance(component, ci, inputsToCreate, propertiesToCreate, inputsValueToCreate, inputName, propInput, isInputValue); if (createInputRes.isRight()) { log.debug("Failed to create input of resource instance for id {} error {}", compInstId, createInputRes.right().value()); @@ -1235,7 +1248,7 @@ public class InputsBusinessLogic extends BaseBusinessLogic { return Either.left(resList); } - private Either createInputForComponentInstance(org.openecomp.sdc.be.model.Component component,org.openecomp.sdc.be.model.Component orignComponent, ComponentInstance ci, Map inputsToCreate, List propertiesToCreate, List inputsValueToCreate, Map dataTypes, String inputName, ComponentInstancePropInput propInput, boolean isInputValue) { + private Either createInputForComponentInstance(org.openecomp.sdc.be.model.Component component, ComponentInstance ci, Map inputsToCreate, List propertiesToCreate, List inputsValueToCreate, String inputName, ComponentInstancePropInput propInput, boolean isInputValue) { String propertiesName = propInput.getPropertiesName() ; PropertyDefinition selectedProp = propInput.getInput(); String[] parsedPropNames = propInput.getParsedPropNames(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeImportManager.java index 7b55a6988e..4a07120994 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeImportManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PolicyTypeImportManager.java @@ -20,7 +20,12 @@ package org.openecomp.sdc.be.components.impl; -import fj.data.Either; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import javax.annotation.Resource; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.components.impl.CommonImportManager.ElementTypeEnum; import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum; @@ -34,10 +39,7 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; +import fj.data.Either; @Component("policyTypeImportManager") public class PolicyTypeImportManager { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ProductComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ProductComponentInstanceBusinessLogic.java index 7a7148a6a1..73f72216d2 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ProductComponentInstanceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ProductComponentInstanceBusinessLogic.java @@ -22,11 +22,8 @@ package org.openecomp.sdc.be.components.impl; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.stereotype.Component; -import fj.data.Either; - @Component("productComponentInstanceBusinessLogic") public class ProductComponentInstanceBusinessLogic extends ComponentInstanceBusinessLogic { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PropertyBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PropertyBusinessLogic.java index e16b34f389..ff26ced5c9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PropertyBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/PropertyBusinessLogic.java @@ -20,11 +20,16 @@ package org.openecomp.sdc.be.components.impl; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.reflect.TypeToken; -import fj.data.Either; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Supplier; + +import javax.servlet.ServletContext; + import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -57,14 +62,12 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.web.context.WebApplicationContext; -import javax.servlet.ServletContext; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.function.Supplier; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.reflect.TypeToken; + +import fj.data.Either; @Component("propertyBusinessLogic") public class PropertyBusinessLogic extends BaseBusinessLogic { @@ -229,7 +232,7 @@ public class PropertyBusinessLogic extends BaseBusinessLogic { return Either.right(componentsUtils.getResponseFormat(ActionStatus.PROPERTY_NOT_FOUND, "")); } for (PropertyDefinition property : properties) { - if (property.getUniqueId().equals(propertyId) && isPropertyBelongsToResource(property, resourceId)) { + if (property.getUniqueId().equals(propertyId) ) { Map propMap = new HashMap<>(); propMap.put(property.getName(), property); return Either.left(propMap.entrySet().iterator().next()); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 1ab7ffb007..4924bd25a7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -55,6 +55,8 @@ import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum; import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction; import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction.LifecycleChanceActionEnum; +import org.openecomp.sdc.be.components.merge.resource.MergeResourceBLFactory; +import org.openecomp.sdc.be.components.merge.resource.MergeResourceBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.be.config.Configuration.VfModuleProperty; @@ -76,6 +78,7 @@ import org.openecomp.sdc.be.info.ArtifactTemplateInfo; import org.openecomp.sdc.be.info.MergedArtifactInfo; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.CapabilityTypeDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; @@ -97,7 +100,7 @@ import org.openecomp.sdc.be.model.Operation; import org.openecomp.sdc.be.model.ParsedToscaYamlInfo; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -127,7 +130,6 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.servlets.RepresentationUtils; import org.openecomp.sdc.be.tosca.CsarUtils; import org.openecomp.sdc.be.tosca.CsarUtils.NonMetaArtifactInfo; -import org.openecomp.sdc.be.tosca.ToscaUtils; import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; import org.openecomp.sdc.be.user.IUserBusinessLogic; import org.openecomp.sdc.be.user.Role; @@ -215,6 +217,9 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { @Autowired private ApplicationDataTypeCache dataTypeCache; + @Autowired + private MergeResourceBLFactory mergeResourceBLFactory; + private Gson gson = new Gson(); public CsarOperation getCsarOperation() { @@ -539,20 +544,12 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } Map>> nodeTypesArtifactsToHandle = findNodeTypesArtifactsToHandleRes.left().value(); try{ - result = updateResourceFromYaml(oldRresource, newRresource, updateResource, createdArtifacts, isUpdateYaml, yamlFileName, yamlFileContents, csarInfo, nodeTypesInfo, nodeTypesArtifactsToHandle, null); + result = updateResourceFromYaml(oldRresource, newRresource, updateResource, createdArtifacts, isUpdateYaml, yamlFileName, yamlFileContents, csarInfo, nodeTypesInfo, nodeTypesArtifactsToHandle, null, false); } finally { if (result == null || result.isRight()) { log.warn("operation failed. do rollback"); titanDao.rollback(); - if (!createdArtifacts.isEmpty()) { - StorageOperationStatus deleteFromEsRes = artifactsBusinessLogic.deleteAllComponentArtifactsIfNotOnGraph(createdArtifacts); - if (!deleteFromEsRes.equals(StorageOperationStatus.OK)) { - ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(deleteFromEsRes); - result = Either.right(componentsUtils.getResponseFormat(actionStatus, oldRresource.getName())); - } - log.debug("component and all its artifacts were deleted, id = {}", oldRresource.getName()); - } } else { log.debug("operation success. do commit"); titanDao.commit(); @@ -566,7 +563,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { private Either updateResourceFromYaml(Resource oldRresource, Resource newRresource, AuditingActionEnum updateResource, List createdArtifacts, boolean isUpdateYaml, String yamlFileName, String yamlFileContent, CsarInfo csarInfo, Map nodeTypesInfo, - Map>> nodeTypesArtifactsToHandle, String nodeName) { + Map>> nodeTypesArtifactsToHandle, String nodeName, boolean isNested) { Either result; Either, ResponseFormat> parseNodeTypeInfoYamlEither; boolean inTransaction = true; @@ -586,7 +583,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if (isUpdateYaml || !nodeTypesArtifactsToHandle.isEmpty()) { - prepareForUpdate = updateExistingResourceByImport(newRresource, oldRresource, csarInfo.getModifier(), inTransaction, shouldLock); + prepareForUpdate = updateExistingResourceByImport(newRresource, oldRresource, csarInfo.getModifier(), inTransaction, shouldLock, isNested); if (prepareForUpdate.isRight()) { log.debug("Failed to prepare resource for update : {}", prepareForUpdate.right().value()); result = Either.right(prepareForUpdate.right().value()); @@ -690,19 +687,35 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { preparedResource = createdCsarArtifactsEither.left().value(); } + ActionStatus mergingPropsAndInputsStatus = mergeResourceEntities(oldRresource, preparedResource); + if (mergingPropsAndInputsStatus != ActionStatus.OK) { + ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(mergingPropsAndInputsStatus, preparedResource); + return Either.right(responseFormat); + } + Either, ResponseFormat> eitherSetPosition = compositionBusinessLogic.setPositionsForComponentInstances(preparedResource, csarInfo.getModifier().getUserId()); result = eitherSetPosition.isRight() ? Either.right(eitherSetPosition.right().value()) : Either.left(preparedResource); return result; } + + private ActionStatus mergeResourceEntities(Resource oldResource, Resource newResource) { + Either mergeResourceBLEither = mergeResourceBLFactory.getInstance(oldResource, newResource); + if (mergeResourceBLEither.isRight()) { + return mergeResourceBLEither.right().value(); + } + MergeResourceBusinessLogic mergeResourceBusinessLogic = mergeResourceBLEither.left().value(); + return mergeResourceBusinessLogic.mergeResourceEntities(oldResource, newResource); + } + private Either handleResourceGenericType(Resource resource) { Either genericResourceEither = fetchAndSetDerivedFromGenericType(resource); if (genericResourceEither.isRight()) { return genericResourceEither; } if (resource.shouldGenerateInputs()) { - generateInputsFromGenericTypeProperties(resource, genericResourceEither.left().value()); + generateAndAddInputsFromGenericTypeProperties(resource, genericResourceEither.left().value()); } return genericResourceEither; } @@ -715,18 +728,22 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { try { nodeTypesArtifactsToHandleRes = Either.left(nodeTypesArtifactsToHandle); - Map extractedVfcToscaNames = extractVfcToscaNames(nodeTypesInfo, oldResource.getName(), csarInfo); + Map> extractedVfcToscaNames = extractVfcToscaNames(nodeTypesInfo, oldResource.getName(), csarInfo); Either>, ResponseFormat> curNodeTypeArtifactsToHandleRes; EnumMap> curNodeTypeArtifactsToHandle = null; log.debug("Going to fetch node types for resource with name {} during import csar with UUID {}. ", oldResource.getName(), csarInfo.getCsarUUID()); - for (Entry currVfcToscaNameEntry : extractedVfcToscaNames.entrySet()) { - String currVfcToscaName = currVfcToscaNameEntry.getValue(); + for (Entry> currVfcToscaNameEntry : extractedVfcToscaNames.entrySet()) { + String currVfcToscaName = currVfcToscaNameEntry.getValue().getLeft(); + String previousVfcToscaName = currVfcToscaNameEntry.getValue().getRight(); String currNamespace = currVfcToscaNameEntry.getKey(); log.debug("Going to fetch node type with tosca name {}. ", currVfcToscaName); Either curVfcRes = toscaOperationFacade.getLatestByToscaResourceName(currVfcToscaName); Resource curNodeType = null; + if (curVfcRes.isRight() && curVfcRes.right().value() == StorageOperationStatus.NOT_FOUND) { + curVfcRes = toscaOperationFacade.getLatestByToscaResourceName(previousVfcToscaName); + } if (curVfcRes.isRight() && curVfcRes.right().value() != StorageOperationStatus.NOT_FOUND) { log.debug("Error occured during fetching node type with tosca name {}, error: {}", currVfcToscaName, curVfcRes.right().value()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(curVfcRes.right().value()), csarInfo.getCsarUUID()); @@ -925,15 +942,15 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return handleNodeTypeArtifactsRes; } - private Map extractVfcToscaNames(Map nodeTypesInfo, String vfResourceName, CsarInfo csarInfo) { - Map vfcToscaNames = new HashMap<>(); + private Map> extractVfcToscaNames(Map nodeTypesInfo, String vfResourceName, CsarInfo csarInfo) { + Map> vfcToscaNames = new HashMap<>(); Map nodes = extractAllNodes(nodeTypesInfo, csarInfo); if (!nodes.isEmpty()) { Iterator> nodesNameEntry = nodes.entrySet().iterator(); while (nodesNameEntry.hasNext()) { Entry nodeType = nodesNameEntry.next(); - String toscaResourceName = buildNestedToscaResourceName(ResourceTypeEnum.VFC.name(), vfResourceName, nodeType.getKey()); + ImmutablePair toscaResourceName = buildNestedToscaResourceName(ResourceTypeEnum.VFC.name(), vfResourceName, nodeType.getKey()); vfcToscaNames.put(nodeType.getKey(), toscaResourceName); } } @@ -1201,7 +1218,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { vfcCreated = handleNeatedVfcYaml.left().value(); } else if(csarInfo.getCreatedNodesToscaResourceNames()!= null && !csarInfo.getCreatedNodesToscaResourceNames().containsKey(nodeType.getKey())){ log.trace("************* Going to create node {}", nodeType.getKey()); - Either, ResponseFormat> resourceCreated = this.createNodeTypeResourceFromYaml(yamlName, nodeType, csarInfo.getModifier(), mapToConvert, resource, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, true, csarInfo); + Either, ResponseFormat> resourceCreated = this.createNodeTypeResourceFromYaml(yamlName, nodeType, csarInfo.getModifier(), mapToConvert, resource, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, true, csarInfo, true); log.debug("************* Finished to create node {}", nodeType.getKey()); if (resourceCreated.isRight()) { @@ -1257,11 +1274,18 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if(result == null){ newComplexVfc = buildCvfcRes.left().value(); Either oldComplexVfcRes = toscaOperationFacade.getFullLatestComponentByToscaResourceName(newComplexVfc.getToscaResourceName()); + if(oldComplexVfcRes.isRight() && oldComplexVfcRes.right().value() == StorageOperationStatus.NOT_FOUND){ + oldComplexVfcRes = toscaOperationFacade.getFullLatestComponentByToscaResourceName(buildNestedToscaResourceName(ResourceTypeEnum.CVFC.name(), csarInfo.getVfResourceName(), nodeName).getRight()); + } if(oldComplexVfcRes.isRight() && oldComplexVfcRes.right().value() != StorageOperationStatus.NOT_FOUND){ log.debug("Failed to fetch previous complex VFC by tosca resource name {}. Status is {}. ", newComplexVfc.getToscaResourceName(), oldComplexVfcRes.right().value()); result = Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); } else if(oldComplexVfcRes.isLeft()){ - oldComplexVfc = oldComplexVfcRes.left().value(); + log.debug("validate derived before update"); + Either eitherValidation = validateNestedDerivedFromDuringUpdate(oldComplexVfcRes.left().value(), newComplexVfc, ValidationUtils.hasBeenCertified(oldComplexVfcRes.left().value().getVersion())); + if (eitherValidation.isLeft()) { + oldComplexVfc = oldComplexVfcRes.left().value(); + } } } if(result == null){ @@ -1298,7 +1322,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { log.debug("Failed to create resource {} from YAML {}. ", newComplexVfc.getName(), yamlName); } } else { - handleComplexVfcRes = updateResourceFromYaml(oldComplexVfc, newComplexVfc, AuditingActionEnum.UPDATE_RESOURCE_METADATA, createdArtifacts, true, yamlContent, yamlName, csarInfo, newNodeTypesInfo, nodesArtifactsToHandle, nodeName); + handleComplexVfcRes = updateResourceFromYaml(oldComplexVfc, newComplexVfc, AuditingActionEnum.UPDATE_RESOURCE_METADATA, createdArtifacts, true, yamlContent, yamlName, csarInfo, newNodeTypesInfo, nodesArtifactsToHandle, nodeName, true); if (handleComplexVfcRes.isRight()) { log.debug("Failed to update resource {} from YAML {}. ", oldComplexVfc.getName(), yamlName); } @@ -1335,13 +1359,13 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } private Either, ResponseFormat> createNodeTypeResourceFromYaml(String yamlName, Entry nodeNameValue, User user, Map mapToConvert, Resource resourceVf, boolean needLock, - Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo) { + Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo, boolean isNested) { Either resourceMetaData = fillResourceMetadata(yamlName, resourceVf, nodeNameValue.getKey(), user); if (resourceMetaData.isRight()) { return Either.right(resourceMetaData.right().value()); } - String singleVfcYaml = buildNodeTypeYaml(nodeNameValue, mapToConvert, resourceMetaData.left().value().getResourceType(), csarInfo.getVfResourceName()); + String singleVfcYaml = buildNodeTypeYaml(nodeNameValue, mapToConvert, resourceMetaData.left().value().getResourceType(), csarInfo); Either eitherCreator = validateUser(user, "CheckIn Resource", resourceVf, AuditingActionEnum.CHECKIN_RESOURCE, true); if (eitherCreator.isRight()) { @@ -1349,10 +1373,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } user = eitherCreator.left().value(); - return this.createResourceFromNodeType(singleVfcYaml, resourceMetaData.left().value(), user, true, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo); + return this.createResourceFromNodeType(singleVfcYaml, resourceMetaData.left().value(), user, true, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeNameValue.getKey(), isNested); } - private String buildNodeTypeYaml(Entry nodeNameValue, Map mapToConvert, String nodeResourceType, String csarVfName) { + private String buildNodeTypeYaml(Entry nodeNameValue, Map mapToConvert, String nodeResourceType, CsarInfo csarInfo) { // We need to create a Yaml from each node_types in order to create // resource from each node type using import normative flow. DumperOptions options = new DumperOptions(); @@ -1360,7 +1384,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { Yaml yaml = new Yaml(options); Map node = new HashMap<>(); - node.put(buildNestedToscaResourceName(nodeResourceType, csarVfName, nodeNameValue.getKey()), nodeNameValue.getValue()); + node.put(buildNestedToscaResourceName(nodeResourceType, csarInfo.getVfResourceName(), nodeNameValue.getKey()).getLeft(), nodeNameValue.getValue()); mapToConvert.put(ToscaTagNamesEnum.NODE_TYPES.getElementName(), node); return yaml.dumpAsMap(mapToConvert); @@ -1376,11 +1400,11 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } public Either, ResponseFormat> createResourceFromNodeType(String nodeTypeYaml, UploadResourceInfo resourceMetaData, User creator, boolean isInTransaction, boolean needLock, - Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo) { + Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo, String nodeName, boolean isNested) { LifecycleChangeInfoWithAction lifecycleChangeInfo = new LifecycleChangeInfoWithAction("certification on import", LifecycleChanceActionEnum.CREATE_FROM_CSAR); Function> validator = (resource) -> this.validateResourceCreationFromNodeType(resource, creator); - return this.resourceImportManager.importCertifiedResource(nodeTypeYaml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, true, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo); + return this.resourceImportManager.importCertifiedResource(nodeTypeYaml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, true, needLock, nodeTypeArtifactsToHandle, nodeTypesNewCreatedArtifacts, forceCertificationAllowed, csarInfo, nodeName, isNested); } private Either fillResourceMetadata(String yamlName, Resource resourceVf, String nodeName, User user) { @@ -1457,7 +1481,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { cvfc.setVendorName(resourceVf.getVendorName()); cvfc.setVendorRelease(resourceVf.getVendorRelease()); cvfc.setResourceVendorModelNumber(resourceVf.getResourceVendorModelNumber()); - cvfc.setToscaResourceName(buildNestedToscaResourceName(ResourceTypeEnum.CVFC.name(), csarInfo.getVfResourceName(), nodeName)); + cvfc.setToscaResourceName(buildNestedToscaResourceName(ResourceTypeEnum.CVFC.name(), csarInfo.getVfResourceName(), nodeName).getLeft()); cvfc.setInvariantUUID(UniqueIdBuilder.buildInvariantUUID()); List tags = new ArrayList<>(); @@ -1521,7 +1545,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { // add groups to resource log.trace("************* Going to add inputs from yaml {}", yamlName); if (resource.shouldGenerateInputs()) - generateInputsFromGenericTypeProperties(resource, genericResourceEither.left().value()); + generateAndAddInputsFromGenericTypeProperties(resource, genericResourceEither.left().value()); Map inputs = parsedToscaYamlInfo.getInputs(); Either createInputsOnResource = createInputsOnResource(resource, csarInfo.getModifier(), inputs, inTransaction); @@ -1599,11 +1623,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { titanDao.rollback(); if (!createdArtifacts.isEmpty() || !nodeTypesNewCreatedArtifacts.isEmpty()) { createdArtifacts.addAll(nodeTypesNewCreatedArtifacts); - StorageOperationStatus deleteFromEsRes = artifactsBusinessLogic.deleteAllComponentArtifactsIfNotOnGraph(createdArtifacts); - if (!deleteFromEsRes.equals(StorageOperationStatus.OK)) { - ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(deleteFromEsRes); - return Either.right(componentsUtils.getResponseFormat(actionStatus, resource.getName())); - } log.debug("component and all its artifacts were deleted, id = {}", resource.getName()); } @@ -1720,7 +1739,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { List resourceProperties = resource.getInputs(); if ( (inputs != null && false == inputs.isEmpty()) || (resourceProperties != null && false == resourceProperties.isEmpty()) ) { - Either, ResponseFormat> createInputs = inputsBusinessLogic.createInputsInGraph(inputs, resource, user, inTransaction); + Either, ResponseFormat> createInputs = inputsBusinessLogic.createInputsInGraph(inputs, resource); if (createInputs.isRight()) { return Either.right(createInputs.right().value()); } @@ -2042,12 +2061,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if (groupsToDelete != null && !groupsToDelete.isEmpty()) { Set artifactsToDelete = new HashSet(); - /* - * for (GroupDefinition group : groupsToDelete) { List artifacts = group.getArtifacts(); if (artifacts != null) { artifactsToDelete.addAll(artifacts); Either deleteGroupEither = - * groupOperation.deleteGroup(group.getUniqueId(), inTransaction); if (deleteGroupEither.isRight()) { StorageOperationStatus storageOperationStatus = deleteGroupEither.right().value(); ActionStatus actionStatus = - * componentsUtils.convertFromStorageResponse(storageOperationStatus); log.debug("Failed to delete group {} under component {}, error: {}", group.getUniqueId(), resource.getNormalizedName(), actionStatus.name()); return - * Either.right(componentsUtils.getResponseFormat(actionStatus)); } } } - */ + for (String artifactId : artifactsToDelete) { Either, ResponseFormat> handleDelete = artifactsBusinessLogic.handleDelete(resource.getUniqueId(), artifactId, csarInfo.getModifier(), AuditingActionEnum.ARTIFACT_DELETE, ComponentTypeEnum.RESOURCE, resource, null, null, shouldLock, inTransaction); @@ -2169,9 +2183,14 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { ////////////////////////////////////// create set parsed ////////////////////////////////////// artifacts/////////////////////////////////////////// Map> parsedArtifactsMap = parseResourceInfoFromYamlEither.left().value(); - Collection> parsedArifactsCollection = parsedArtifactsMap.values(); + Map> parsedGroup = new HashMap>(); - + List artifactsWithoutGroups = null; + if(parsedArtifactsMap.containsKey(ArtifactTemplateInfo.CSAR_ARTIFACT)){ + artifactsWithoutGroups = parsedArtifactsMap.get(ArtifactTemplateInfo.CSAR_ARTIFACT); + parsedArtifactsMap.remove(ArtifactTemplateInfo.CSAR_ARTIFACT); + } + Collection> parsedArifactsCollection = parsedArtifactsMap.values(); for (List parsedGroupTemplateList : parsedArifactsCollection) { for (ArtifactTemplateInfo parsedGroupTemplate : parsedGroupTemplateList) { @@ -2235,7 +2254,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { ////////////// artifacts//////////////////////////// Either assDissotiateEither = associateAndDissociateArtifactsToGroup(csarInfo, resource, createdNewArtifacts, labelCounter, shouldLock, inTransaction, createdDeplymentArtifactsAfterDelete, mergedgroup, deletedArtifacts); - + groups = resource.getGroups(); if (assDissotiateEither.isRight()) { log.debug("Failed to delete artifacts. Status is {} ", assDissotiateEither.right().value()); @@ -2251,7 +2270,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } - groups = resource.getGroups(); + // update vfModule names Set groupForAssociateWithMembers = mergedgroup.keySet(); @@ -2331,7 +2350,16 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } - + if(artifactsWithoutGroups != null && !artifactsWithoutGroups.isEmpty()){ + for(ArtifactTemplateInfo t: artifactsWithoutGroups){ + List arrtifacts = new ArrayList(); + arrtifacts.add(t); + Either resStatus = createGroupDeploymentArtifactsFromCsar(csarInfo, resource, arrtifacts, createdNewArtifacts, createdDeplymentArtifactsAfterDelete, labelCounter, shouldLock, inTransaction); + if (resStatus.isRight()) + return resStatus; + }; + } + Either eitherGerResource = toscaOperationFacade.getToscaElement(resource.getUniqueId()); if (eitherGerResource.isRight()) { ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGerResource.right().value()), resource); @@ -2351,17 +2379,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { for (ArtifactDefinition artifact : artifactsToDelete) { String artifactType = artifact.getArtifactType(); ArtifactTypeEnum artifactTypeEnum = ArtifactTypeEnum.findType(artifactType); - if (artifactTypeEnum == ArtifactTypeEnum.HEAT_ENV) { - - /* - * Either removeArifactFromGraph = artifactOperation.removeArifactFromResource(resourceId, artifact.getUniqueId(), NodeTypeEnum.Resource, true, true); if - * (removeArifactFromGraph.isRight()) { StorageOperationStatus status = removeArifactFromGraph.right().value(); log.debug("Failed to delete heat env artifact {} . status is {}", artifact.getUniqueId(), status); ActionStatus - * actionStatus = componentsUtils.convertFromStorageResponse(status); return Either.right(componentsUtils.getResponseFormat(actionStatus)); } - * - * deletedArtifacts.add(removeArifactFromGraph.left().value()); - */ - - } else { + if (artifactTypeEnum != ArtifactTypeEnum.HEAT_ENV) { Either, ResponseFormat> handleDelete = artifactsBusinessLogic.handleDelete(resourceId, artifact.getUniqueId(), user, AuditingActionEnum.ARTIFACT_DELETE, ComponentTypeEnum.RESOURCE, resource, null, null, shouldLock, inTransaction); if (handleDelete.isRight()) { @@ -2425,8 +2443,9 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { GroupDefinition groupToUpdate = artifactsToUpdateEntry.getKey(); for (ImmutablePair artifact : artifactsToUpdateList) { - String prevUUID = artifact.getKey().getArtifactUUID(); + String prevUUID = artifact.getKey().getArtifactUUID(); String prevId = artifact.getKey().getUniqueId(); + String prevHeatEnvId = checkAndGetHeatEnvId(artifact.getKey()); Either updateArtifactEither = updateDeploymentArtifactsFromCsar(csarInfo, resource, artifact.getKey(), artifact.getValue(), updatedArtifacts, artifact.getRight().getRelatedArtifactsInfo(), shouldLock, inTransaction); if (updateArtifactEither.isRight()) { @@ -2441,6 +2460,13 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { groupToUpdate.getArtifacts().add(artAfterUpdate.getUniqueId()); groupToUpdate.getArtifactsUuid().add(artAfterUpdate.getArtifactUUID()); } + Optional op = updatedArtifacts.stream().filter(p -> p.getGeneratedFromId() != null && p.getGeneratedFromId().equals(artAfterUpdate.getUniqueId())).findAny(); + if (op.isPresent()) { + ArtifactDefinition artifactInfoHeatEnv = op.get(); + groupToUpdate.getArtifacts().remove(prevHeatEnvId); + groupToUpdate.getArtifacts().add(artifactInfoHeatEnv.getUniqueId()); + } + } } } @@ -2521,16 +2547,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } - /* - * if (!associateArtifactGroup.isEmpty()) { - * - * log.debug("Try to associate artifacts to groups."); - * - * Either, ResponseFormat> assotiateGroupEither = groupBusinessLogic.associateArtifactsToGroup(resource.getUniqueId(), user.getUserId(), ComponentTypeEnum.RESOURCE, associateArtifactGroup, shouldLock, inTransaction); if - * (assotiateGroupEither.isRight()) { log.debug("Failed to associate artifacts to groups. Status is {} ", assotiateGroupEither.right().value()); resEither = Either.right(assotiateGroupEither.right().value()); return resEither; - * - * } } - */ + ComponentParametersView parametersView = new ComponentParametersView(); parametersView.disableAll(); @@ -3332,6 +3349,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return resStatus; } ArtifactDefinition currentInfo = uploadArtifactToService.left().value().left().value(); + updatedArtifacts.add(currentInfo); Either updateEnvEither = updateHeatParamsFromCsar(resource, csarInfo, artifactTemplateInfo, currentInfo, true); if (updateEnvEither.isRight()) { @@ -3342,7 +3360,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { // TODO evg update env time ( must be separate US for this!!!!) updatedArtifacts.add(updateEnvEither.left().value()); - resStatus = Either.left(updateEnvEither.left().value()); + resStatus = Either.left(currentInfo); return resStatus; @@ -3359,11 +3377,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return resStatus; } Either, ResponseFormat> propsStatus = extractHeatParameters(ArtifactTypeEnum.HEAT_ENV.getType(), artifactTemplateInfo.getEnv(), artifactparamsStatus.left().value().getValue(), false); - /* - * if (propsStatus.isRight()) { - * - * resStatus = Either.right(propsStatus.right().value()); return resStatus; } - */ + if (propsStatus.isLeft()) { List updatedHeatEnvParams = propsStatus.left().value(); List currentHeatEnvParams = currentInfo.getListHeatParameters(); @@ -3405,6 +3419,23 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } if (isUpdateEnv) { + ComponentParametersView parametersView = new ComponentParametersView(); + parametersView.disableAll(); + parametersView.setIgnoreComponentInstances(false); + parametersView.setIgnoreUsers(false); + parametersView.setIgnoreArtifacts(false); + parametersView.setIgnoreGroups(false); + + Either eitherGerResource = toscaOperationFacade.getToscaElement(resource.getUniqueId(), parametersView); + + if (eitherGerResource.isRight()) { + ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGerResource.right().value()), resource); + + resStatus = Either.right(responseFormat); + return resStatus; + + } + resource = eitherGerResource.left().value(); Map artifacts = resource.getDeploymentArtifacts(); Optional op = artifacts.values().stream().filter(p -> p.getGeneratedFromId() != null && p.getGeneratedFromId().equals(currentInfo.getUniqueId())).findAny(); if (op.isPresent()) { @@ -3414,6 +3445,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { log.debug("Failed to update heat env on CSAR flow for component {} artifact {} label {}", resource.getUniqueId(), artifactInfoHeatEnv.getUniqueId(), artifactInfoHeatEnv.getArtifactLabel()); return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(updateArifactOnResource.right().value()))); } + resStatus = Either.left(updateArifactOnResource.left().value()); } } return resStatus; @@ -3821,7 +3853,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { String value = null; List getInputs = null; boolean isValidate = true; - if (null != propertyInfo && null != propertyInfo.getValue()) { + if (propertyInfo.getValue() != null) { getInputs = propertyInfo.getGet_input(); isValidate = getInputs == null || getInputs.isEmpty(); if (isValidate) { @@ -3944,10 +3976,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } RequirementDefinition validReq = eitherReqStatus.left().value(); - List reqAndRelationshipPairList = regCapRelDef.getRelationships(); + List reqAndRelationshipPairList = regCapRelDef.getRelationships(); if (reqAndRelationshipPairList == null) - reqAndRelationshipPairList = new ArrayList(); - RequirementAndRelationshipPair reqAndRelationshipPair = new RequirementAndRelationshipPair(); + reqAndRelationshipPairList = new ArrayList<>(); + RelationshipInfo reqAndRelationshipPair = new RelationshipInfo(); reqAndRelationshipPair.setRequirement(regName); reqAndRelationshipPair.setRequirementOwnerId(validReq.getOwnerId()); reqAndRelationshipPair.setRequirementUid(validReq.getUniqueId()); @@ -3982,7 +4014,9 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { reqAndRelationshipPair.setCapability(aviableCapForRel.getName()); reqAndRelationshipPair.setCapabilityUid(aviableCapForRel.getUniqueId()); reqAndRelationshipPair.setCapabilityOwnerId(aviableCapForRel.getOwnerId()); - reqAndRelationshipPairList.add(reqAndRelationshipPair); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(reqAndRelationshipPair); + reqAndRelationshipPairList.add(capReqRel); regCapRelDef.setRelationships(reqAndRelationshipPairList); relations.add(regCapRelDef); } @@ -4151,8 +4185,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(validatevalueEiter.right().value())); } - // String uniqueId = UniqueIdBuilder.buildResourceInstancePropertyValueUid(currentCompInstance.getComponentUid(), index++); - // property.setUniqueId(uniqueId); property.setValue(validatevalueEiter.left().value()); if (getInputs != null && !getInputs.isEmpty()) { @@ -4239,18 +4271,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } - - // TODO temporary fix - remove specific capability node validation - - // String reqNode = validReq.getNode(); - // if (reqNode != null && !reqNode.isEmpty() && - // !cap.getCapabilitySources().contains(reqNode)) { - // return null; - // } - // RequirementAndRelationshipPair relationPair = getReqRelPair(cap); - // Either eitherStatus = componentInstanceOperation.isAvailableCapabilty(currentCapCompInstance, relationPair); - // if (eitherStatus.isRight() || eitherStatus.left().value() == false) { - // return null; - // } return cap; } @@ -4261,13 +4281,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { List capList = capMap.get(validReq.getCapability()); for (CapabilityDefinition cap : capList) { - // TODO temporary fix - remove specific capability node - // String reqNode = validReq.getNode(); - // if (reqNode != null && !reqNode.isEmpty()) { - // if (!cap.getCapabilitySources().contains(reqNode)) { - // continue; - // } - // } if (cap.getMaxOccurrences() != null && !cap.getMaxOccurrences().equals(CapabilityDataDefinition.MAX_OCCURRENCES)) { String leftOccurrences = cap.getLeftOccurrences(); if (leftOccurrences == null) { @@ -5097,7 +5110,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { * createOrUpdateResourceByImport(resource, user, isNormative, false, needLock); } */ - public Either, ResponseFormat> createOrUpdateResourceByImport(Resource resource, User user, boolean isNormative, boolean isInTransaction, boolean needLock, CsarInfo csarInfo) { + public Either, ResponseFormat> createOrUpdateResourceByImport(Resource resource, User user, boolean isNormative, boolean isInTransaction, boolean needLock, CsarInfo csarInfo, String nodeName, boolean isNested) { // check if resource already exist Either latestByName = toscaOperationFacade.getLatestByName(resource.getName()); @@ -5107,10 +5120,22 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if (latestByName.isRight() && latestByName.right().value().equals(StorageOperationStatus.NOT_FOUND)) { Either latestByToscaName = toscaOperationFacade.getLatestByToscaResourceName(resource.getToscaResourceName()); - if (latestByToscaName.isRight() && latestByToscaName.right().value().equals(StorageOperationStatus.NOT_FOUND)) + if (csarInfo!= null && csarInfo.isUpdate() && nodeName != null && latestByToscaName.isRight() && latestByToscaName.right().value().equals(StorageOperationStatus.NOT_FOUND)){ + latestByToscaName = toscaOperationFacade.getLatestByToscaResourceName(buildNestedToscaResourceName(resource.getResourceType().name(), csarInfo.getVfResourceName(), nodeName).getRight()); + // update + if (latestByToscaName.isLeft()) { + log.debug("validate derived before update"); + Either eitherValidation = validateNestedDerivedFromDuringUpdate(latestByToscaName.left().value(), resource, ValidationUtils.hasBeenCertified(latestByToscaName.left().value().getVersion())); + if (eitherValidation.isRight()) { + result = createResourceByImport(resource, user, isNormative, isInTransaction, csarInfo); + } else { + result = updateExistingResourceByImport(resource, latestByToscaName.left().value(), user, isNormative, needLock, isNested); + } + } + } + if (result == null && latestByToscaName.isRight() && latestByToscaName.right().value().equals(StorageOperationStatus.NOT_FOUND)){ result = createResourceByImport(resource, user, isNormative, isInTransaction, csarInfo); - - else { + } else if (result == null){ StorageOperationStatus status = latestByName.right().value(); BeEcompErrorManager.getInstance().logBeComponentMissingError("Create / Update resource by import", ComponentTypeEnum.RESOURCE.getValue(), resource.getName()); log.debug("resource already exist {}. status={}", resource.getName(), status); @@ -5123,7 +5148,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { // update else if (latestByName.isLeft()) { - result = updateExistingResourceByImport(resource, latestByName.left().value(), user, isNormative, needLock); + result = updateExistingResourceByImport(resource, latestByName.left().value(), user, isNormative, needLock, isNested); } // error @@ -5160,7 +5185,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return latestByName.isLeft(); } - private Either, ResponseFormat> updateExistingResourceByImport(Resource newResource, Resource oldResource, User user, boolean inTransaction, boolean needLock) { + private Either, ResponseFormat> updateExistingResourceByImport(Resource newResource, Resource oldResource, User user, boolean inTransaction, boolean needLock, boolean isNested) { String lockedResourceId = oldResource.getUniqueId(); log.debug("found resource: name={}, id={}, version={}, state={}", oldResource.getName(), lockedResourceId, oldResource.getVersion(), oldResource.getLifecycleState()); Either, ResponseFormat> result = null; @@ -5184,7 +5209,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { mergeOldResourceMetadataWithNew(oldResource, newResource); - Either validateFieldsResponse = validateResourceFieldsBeforeUpdate(oldResource, newResource, inTransaction); + Either validateFieldsResponse = validateResourceFieldsBeforeUpdate(oldResource, newResource, inTransaction, isNested); if (validateFieldsResponse.isRight()) { result = Either.right(validateFieldsResponse.right().value()); return result; @@ -5211,7 +5236,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { newResource.setSystemName(oldResource.getSystemName()); if (oldResource.getCsarUUID() != null) { newResource.setCsarUUID(oldResource.getCsarUUID()); - } + } if (oldResource.getImportedToscaChecksum() != null) { newResource.setImportedToscaChecksum(oldResource.getImportedToscaChecksum()); } @@ -5957,7 +5982,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } //endregion - Either validateResourceFields = validateResourceFieldsBeforeUpdate(currentResource, newResource, inTransaction); + Either validateResourceFields = validateResourceFieldsBeforeUpdate(currentResource, newResource, inTransaction, false); if (validateResourceFields.isRight()) { return Either.right(validateResourceFields.right().value()); } @@ -6117,15 +6142,16 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { * validateResourceFieldsBeforeUpdate * * @param currentResource - Resource object to validate + * @param isNested * @return Either */ - private Either validateResourceFieldsBeforeUpdate(Resource currentResource, Resource updateInfoResource, boolean inTransaction) { + private Either validateResourceFieldsBeforeUpdate(Resource currentResource, Resource updateInfoResource, boolean inTransaction, boolean isNested) { boolean hasBeenCertified = ValidationUtils.hasBeenCertified(currentResource.getVersion()); // validate resource name log.debug("validate resource name before update"); - Either eitherValidation = validateResourceName(currentResource, updateInfoResource, hasBeenCertified); + Either eitherValidation = validateResourceName(currentResource, updateInfoResource, hasBeenCertified, isNested); if (eitherValidation.isRight()) { return eitherValidation; } @@ -6314,10 +6340,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return resourceName+"Cvfc"; } - private Either validateResourceName(Resource currentResource, Resource updateInfoResource, boolean hasBeenCertified) { + private Either validateResourceName(Resource currentResource, Resource updateInfoResource, boolean hasBeenCertified, boolean isNested) { String resourceNameUpdated = updateInfoResource.getName(); if (!isResourceNameEquals(currentResource, updateInfoResource)) { - if (!hasBeenCertified) { + if (isNested || !hasBeenCertified) { Either validateResourceNameResponse = validateComponentName(null, updateInfoResource, null); if (validateResourceNameResponse.isRight()) { ResponseFormat errorResponse = validateResourceNameResponse.right().value(); @@ -6449,6 +6475,36 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } return Either.left(true); } + + private Either validateNestedDerivedFromDuringUpdate(Resource currentResource, Resource updateInfoResource, boolean hasBeenCertified) { + + List currentDerivedFrom = currentResource.getDerivedFrom(); + List updatedDerivedFrom = updateInfoResource.getDerivedFrom(); + if (currentDerivedFrom == null || currentDerivedFrom.isEmpty() || updatedDerivedFrom == null || updatedDerivedFrom.isEmpty()) { + log.trace("Update normative types"); + return Either.left(true); + } + + String derivedFromCurrent = currentDerivedFrom.get(0); + String derivedFromUpdated = updatedDerivedFrom.get(0); + + if (!derivedFromCurrent.equals(derivedFromUpdated)) { + if (!hasBeenCertified) { + Either validateDerivedFromExistsEither = validateDerivedFromExist(null, updateInfoResource, null); + if (validateDerivedFromExistsEither.isRight()) { + return validateDerivedFromExistsEither; + } + } else { + Either validateDerivedFromExtending = validateDerivedFromExtending(null, currentResource, updateInfoResource, null); + + if (validateDerivedFromExtending.isRight() || !validateDerivedFromExtending.left().value()) { + log.debug("Derived from cannot be updated if it doesnt inherits directly or extends inheritance"); + return validateDerivedFromExtending; + } + } + } + return Either.left(true); + } private Either validateDerivedFromExist(User user, Resource resource, AuditingActionEnum actionEnum) { @@ -7309,9 +7365,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } - private String buildNestedToscaResourceName(String nodeResourceType, String vfResourceName, String nodeTypeFullName) { + private ImmutablePair buildNestedToscaResourceName(String nodeResourceType, String vfResourceName, String nodeTypeFullName) { String actualType; String actualVfName; + String actualPreviousVfName; if(ResourceTypeEnum.CVFC.name().equals(nodeResourceType)){ actualVfName = vfResourceName + ResourceTypeEnum.CVFC.name(); actualType = ResourceTypeEnum.VFC.name(); @@ -7319,6 +7376,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { actualVfName = vfResourceName; actualType = nodeResourceType; } + StringBuilder toscaResourceName = new StringBuilder(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX); String nameWithouNamespacePrefix = nodeTypeFullName.substring(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX.length()); String[] findTypes = nameWithouNamespacePrefix.split("\\."); @@ -7330,7 +7388,8 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } else { toscaResourceName.append(actualType.toLowerCase()).append('.').append(ValidationUtils.convertToSystemName(actualVfName)).append('.').append(Constants.ABSTRACT); } - return toscaResourceName.append(actualName.toLowerCase()).toString(); + StringBuilder previousToscaResourceName = new StringBuilder(toscaResourceName); + return new ImmutablePair<>(toscaResourceName.append(actualName.toLowerCase()).toString(), previousToscaResourceName.append(actualName.substring(actualName.split("\\.")[1].length() + 1).toLowerCase()).toString()); } public ICacheMangerOperation getCacheManagerOperation() { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java index b21195ff42..7ed90ce3b6 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java @@ -20,7 +20,22 @@ package org.openecomp.sdc.be.components.impl; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import javax.servlet.ServletContext; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.auditing.api.IAuditingManager; @@ -38,7 +53,17 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.WebAppContextWrapper; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.CsarInfo; +import org.openecomp.sdc.be.model.InterfaceDefinition; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.UploadResourceInfo; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; @@ -57,20 +82,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.context.WebApplicationContext; import org.yaml.snakeyaml.Yaml; -import javax.servlet.ServletContext; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.function.Function; -import java.util.regex.Pattern; -import java.util.stream.Collectors; +import fj.data.Either; @Component("resourceImportManager") public class ResourceImportManager { @@ -110,7 +122,7 @@ public class ResourceImportManager { lifecycleChangeInfo.setUserRemarks("certification on import"); Function> validator = (resource) -> resourceBusinessLogic.validatePropertiesDefaultValues(resource); - return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, false, createNewVersion, needLock, null, null, false, null); + return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, false, createNewVersion, needLock, null, null, false, null, null, false); } public Either, ResponseFormat> importNormativeResourceFromCsar(String resourceYml, UploadResourceInfo resourceMetaData, User creator, boolean createNewVersion, boolean needLock) { @@ -119,11 +131,11 @@ public class ResourceImportManager { lifecycleChangeInfo.setUserRemarks("certification on import"); Function> validator = (resource) -> resourceBusinessLogic.validatePropertiesDefaultValues(resource); - return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, false, createNewVersion, needLock, null, null, false, null); + return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, false, createNewVersion, needLock, null, null, false, null, null, false); } public Either, ResponseFormat> importCertifiedResource(String resourceYml, UploadResourceInfo resourceMetaData, User creator, Function> validationFunction, - LifecycleChangeInfoWithAction lifecycleChangeInfo, boolean isInTransaction, boolean createNewVersion, boolean needLock, Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo) { + LifecycleChangeInfoWithAction lifecycleChangeInfo, boolean isInTransaction, boolean createNewVersion, boolean needLock, Map> nodeTypeArtifactsToHandle, List nodeTypesNewCreatedArtifacts, boolean forceCertificationAllowed, CsarInfo csarInfo, String nodeName, boolean isNested) { Resource resource = new Resource(); ImmutablePair responsePair = new ImmutablePair<>(resource, ActionStatus.CREATED); Either, ResponseFormat> response = Either.left(responsePair); @@ -152,7 +164,7 @@ public class ResourceImportManager { } } - response = resourceBusinessLogic.createOrUpdateResourceByImport(resource, creator, true, isInTransaction, needLock, csarInfo); + response = resourceBusinessLogic.createOrUpdateResourceByImport(resource, creator, true, isInTransaction, needLock, csarInfo, nodeName, isNested); Either changeStateResponse; if (response.isLeft()) { resource = response.left().value().left; @@ -240,7 +252,7 @@ public class ResourceImportManager { Either validatePropertiesTypes = resourceBusinessLogic.validatePropertiesDefaultValues(resource); if (validatePropertiesTypes.isLeft()) { - response = resourceBusinessLogic.createOrUpdateResourceByImport(resource, creator, false, isInTransaction, true, null); + response = resourceBusinessLogic.createOrUpdateResourceByImport(resource, creator, false, isInTransaction, true, null, null, false); } else { ResponseFormat validationErrorResponse = validatePropertiesTypes.right().value(); auditErrorImport(resourceMetaData, creator, validationErrorResponse, false); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResponseFormatManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResponseFormatManager.java index e8c0bf3d8a..136121484d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResponseFormatManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResponseFormatManager.java @@ -20,13 +20,11 @@ package org.openecomp.sdc.be.components.impl; -import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.ErrorConfiguration; import org.openecomp.sdc.be.config.ErrorInfo; import org.openecomp.sdc.be.config.ErrorInfo.ErrorInfoType; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.exception.OkResponseInfo; import org.openecomp.sdc.exception.PolicyException; import org.openecomp.sdc.exception.ResponseFormat; @@ -60,7 +58,6 @@ public class ResponseFormatManager { ErrorConfiguration errorConfiguration = configurationManager.getErrorConfiguration(); ErrorInfo errorInfo = errorConfiguration.getErrorInfo(responseEnum.name()); if (errorInfo == null) { - BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.EcompErrorNotFound, "ResponseFormatManager", responseEnum.name()); log.debug("failed to locate {} in error configuration", responseEnum.name()); errorInfo = errorConfiguration.getErrorInfo(ActionStatus.GENERAL_ERROR.name()); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java index 89c444b6d9..23852c30a2 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.be.components.impl; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.EnumMap; import java.util.HashMap; @@ -359,7 +358,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { if (genericServiceEither.isRight()) return Either.right(genericServiceEither.right().value()); - generateInputsFromGenericTypeProperties(service, genericServiceEither.left().value()); + generateAndAddInputsFromGenericTypeProperties(service, genericServiceEither.left().value()); Either dataModelResponse = toscaOperationFacade.createToscaComponent(service); @@ -711,7 +710,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { String uuidUpdated = serviceUpdate.getUUID(); String uuidCurrent = currentService.getUUID(); if (!uuidCurrent.equals(uuidUpdated)) { - log.info("update srvice: recived request to update uuid to {} the field is not updatable ignoring.", uuidUpdated); + log.info("update service: recived request to update uuid to {} the field is not updatable ignoring.", uuidUpdated); } response = validateAndUpdateServiceType(user, currentService, serviceUpdate, null); @@ -734,7 +733,9 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { serviceUpdate.setInvariantUUID(currentInvariantUuid); } validateAndUpdateEcompNaming(currentService, serviceUpdate); - + + currentService.setEnvironmentContext(serviceUpdate.getEnvironmentContext()); + return Either.left(currentService); } @@ -1508,7 +1509,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { return vfModuleAertifact; } - private void fillVfModuleInstHeatEnvPayload(List groupsForCurrVF, ComponentInstance currVFInstance, Wrapper payloadWrapper) { + private void fillVfModuleInstHeatEnvPayload(List groupsForCurrVF, Wrapper payloadWrapper) { // Converts GroupDefinition to VfModuleArtifactPayload which is the // format used in the payload @@ -1531,37 +1532,13 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { } - private void addHeatEnvArtifactsToVFModulePayload(VfModuleArtifactPayload vfModulePayload, ComponentInstance currVFInstance) { - List originalModuleArtifacts = vfModulePayload.getArtifacts(); - if (!MapUtils.isEmpty(currVFInstance.getDeploymentArtifacts()) && !CollectionUtils.isEmpty(originalModuleArtifacts)) { - - // EVG : fix now for patch. remove null from list. Need to be fixed later : remove VF HEAT ENV uuid from the list?? - List filteredUUIDFromModule = originalModuleArtifacts.stream().filter(uuid -> uuid != null).collect(Collectors.toList()); - - final Collection depInsArtifacts = currVFInstance.getDeploymentArtifacts().values(); - // All Heat_ENV - List heatEnvArtifacts = depInsArtifacts.stream().filter(art -> art.getArtifactType().equals(ArtifactTypeEnum.HEAT_ENV.getType())).collect(Collectors.toList()); - // Unique Id Of Artifacts In the vf module - List moduleArtUniqueId = depInsArtifacts.stream().filter(art -> originalModuleArtifacts.contains(art.getArtifactUUID())).map(art -> art.getUniqueId()).collect(Collectors.toList()); - // Collect Only Heat Artifatcs that are Generated from artifacts in - // the module - List relevantHeatEnvUUID = heatEnvArtifacts.stream().filter(heatEnv -> moduleArtUniqueId.contains(heatEnv.getGeneratedFromId())).map(heatEnv -> heatEnv.getArtifactUUID()).collect(Collectors.toList()); - - List fullArtifactList = new ArrayList<>(); - fullArtifactList.addAll(filteredUUIDFromModule); - fullArtifactList.addAll(relevantHeatEnvUUID); - - vfModulePayload.setArtifacts(fullArtifactList); - } - } - private Either generateVfModuleInstanceArtifact(User modifier, ComponentInstance currVFInstance, Service service, boolean shouldLock) { ArtifactDefinition vfModuleAertifact = null; Wrapper responseWrapper = new Wrapper<>(); Wrapper payloadWrapper = new Wrapper<>(); List groupsForCurrVF = collectGroupsInstanceForCompInstance(currVFInstance, responseWrapper); if (responseWrapper.isEmpty()) { - fillVfModuleInstHeatEnvPayload(groupsForCurrVF, currVFInstance, payloadWrapper); + fillVfModuleInstHeatEnvPayload(groupsForCurrVF, payloadWrapper); } if (responseWrapper.isEmpty() && payloadWrapper.getInnerElement() != null) { vfModuleAertifact = getVfModuleInstArtifactForCompInstance(currVFInstance, service, modifier, groupsForCurrVF, payloadWrapper, responseWrapper); @@ -1694,7 +1671,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { @Override public Either call() throws Exception { - return artifactsBusinessLogic.generateHeatEnvArtifact(artifactDefinition, ComponentTypeEnum.RESOURCE_INSTANCE, service, resourceInstanceName, modifier, shouldLock, instanceId); + return artifactsBusinessLogic.forceGenerateHeatEnvArtifact(artifactDefinition, ComponentTypeEnum.RESOURCE_INSTANCE, service, resourceInstanceName, modifier, shouldLock, instanceId); } public ArtifactDefinition getArtifactDefinition() { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/VFComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/VFComponentInstanceBusinessLogic.java index 5a93ecf182..c5db7ee022 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/VFComponentInstanceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/VFComponentInstanceBusinessLogic.java @@ -20,19 +20,12 @@ package org.openecomp.sdc.be.components.impl; -import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.tosca.ToscaUtils; -import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; -import fj.data.Either; - @Component("vfComponentInstanceBusinessLogic") public class VFComponentInstanceBusinessLogic extends ComponentInstanceBusinessLogic { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogic.java new file mode 100644 index 0000000000..7f6abe7f2c --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogic.java @@ -0,0 +1,91 @@ +package org.openecomp.sdc.be.components.impl.generic; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.collections.CollectionUtils; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; + +@org.springframework.stereotype.Component +public class GenericTypeBusinessLogic { + + private final static Logger log = LoggerFactory.getLogger(GenericTypeBusinessLogic.class); + + @Autowired + private ComponentsUtils componentsUtils; + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + + /** + * @param component the component of which to fetch its generic type + * @return the generic node type which corresponds to the given component + */ + public Either fetchDerivedFromGenericType(Component component){ + String genericTypeToscaName = getGenericTypeToscaName(component); + log.debug("Fetching generic tosca name {}", genericTypeToscaName); + if(null == genericTypeToscaName) { + log.debug("Failed to fetch certified generic node type for component {}", component.getName()); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + + Either findLatestGeneric = toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(genericTypeToscaName); + if(findLatestGeneric.isRight()){ + log.debug("Failed to fetch certified node type by tosca resource name {}", genericTypeToscaName); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERIC_TYPE_NOT_FOUND, component.assetType(), genericTypeToscaName)); + } + + Resource genericTypeResource = findLatestGeneric.left().value(); + return Either.left(genericTypeResource); + } + + /** + * + * @param genericType the generic node type + * @return the generic type properties as inputs + */ + public List generateInputsFromGenericTypeProperties(Resource genericType) { + List genericTypeProps = genericType.getProperties(); + if(null != genericTypeProps) { + return convertGenericTypePropertiesToInputsDefintion(genericTypeProps, genericType.getUniqueId()); + } + return new ArrayList<>(); + } + + public List convertGenericTypePropertiesToInputsDefintion(List genericTypeProps, String genericUniqueId) { + return genericTypeProps.stream() + .map(p -> setInputDefinitionFromProp(p, genericUniqueId)) + .collect(Collectors.toList()); + } + + private InputDefinition setInputDefinitionFromProp(PropertyDefinition prop, String genericUniqueId){ + InputDefinition input = new InputDefinition(prop); + input.setOwnerId(genericUniqueId); + return input; + } + + private String getGenericTypeToscaName(T component) { + return isCvfcHasDerivedFrom(component) ? ((Resource)component).getDerivedFrom().get(0) : component.fetchGenericTypeToscaNameFromConfig(); + } + + private boolean isCvfcHasDerivedFrom(T component) { + return component.getComponentType() == ComponentTypeEnum.RESOURCE && ((Resource)component).getResourceType() == ResourceTypeEnum.CVFC && CollectionUtils.isNotEmpty(((Resource)component).getDerivedFrom()); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransition.java index 0e0f6f9464..47e494f66d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransition.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.components.lifecycle; import java.util.Arrays; + import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTransition.java index d12afdbd55..4a7f446739 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTransition.java @@ -20,7 +20,14 @@ package org.openecomp.sdc.be.components.lifecycle; -import fj.data.Either; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; + import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; @@ -32,7 +39,15 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.Operation; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation; @@ -48,14 +63,7 @@ import org.openecomp.sdc.exception.ResponseFormat; 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.Map.Entry; -import java.util.Optional; -import java.util.Set; +import fj.data.Either; public class CertificationRequestTransition extends LifeCycleTransition { @@ -229,12 +237,12 @@ public class CertificationRequestTransition extends LifeCycleTransition { } finally { if (result == null || result.isRight()) { BeEcompErrorManager.getInstance().logBeDaoSystemError("Change LifecycleState"); - if (inTransaction == false) { + if (!inTransaction) { log.debug("operation failed. do rollback"); titanDao.rollback(); } } else { - if (inTransaction == false) { + if (!inTransaction) { log.debug("operation success. do commit"); titanDao.commit(); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTransition.java index 14f54e4c19..b7983b1174 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTransition.java @@ -21,10 +21,7 @@ package org.openecomp.sdc.be.components.lifecycle; import java.util.Arrays; -import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -32,22 +29,17 @@ import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; -import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; -import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation; -import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementOperation; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; @@ -108,11 +100,22 @@ public class CheckoutTransition extends LifeCycleTransition { } else { Component clonedComponent = ModelConverter.convertFromToscaElement(checkoutResourceResult.left().value()); + if ( checkoutResourceResult.left().value().getToscaType() == ToscaElementTypeEnum.NodeType ){ + Either upgradeToLatestDerived = componentBl.shouldUpgradeToLatestDerived(clonedComponent); + if (upgradeToLatestDerived.isRight() && ActionStatus.OK != upgradeToLatestDerived.right().value()){ + result = Either.right(componentUtils.getResponseFormat(upgradeToLatestDerived.right().value())); + return result; + } + if ( upgradeToLatestDerived.isLeft() ){ + //get resource after update derived + clonedComponent = upgradeToLatestDerived.left().value(); + } + } result = Either.left(clonedComponent); Either upgradeToLatestGeneric = componentBl.shouldUpgradeToLatestGeneric(clonedComponent); if (upgradeToLatestGeneric.isRight()) result = Either.right(upgradeToLatestGeneric.right().value()); - else if (upgradeToLatestGeneric.left().value()) { + else if (upgradeToLatestGeneric.left().value() ) { StorageOperationStatus response = upgradeToLatestGenericData(clonedComponent); if (StorageOperationStatus.OK != response) { ActionStatus actionStatus = componentUtils.convertFromStorageResponse(response); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifeCycleTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifeCycleTransition.java index cc534bb694..87e8175960 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifeCycleTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifeCycleTransition.java @@ -145,10 +145,12 @@ public abstract class LifeCycleTransition { if (getAuthorizedRoles(componentType).contains(Role.valueOf(modifier.getRole())) || userResourceRoleValidation(component,componentType,modifier)) { return Either.left(true); } - // this is only when creating vfc/cp when import vf from csar - when we + // this is only used in 2 cases + //1. when creating vfc/cp when import vf from csar - when we // create resources from node type, we create need to change the state // to certified - if (lifecycleChangeInfo != null && lifecycleChangeInfo.getAction() != null && lifecycleChangeInfo.getAction() == LifecycleChanceActionEnum.CREATE_FROM_CSAR) { + //2. certification flow upno upgrade migration + if (lifecycleChangeInfo != null && lifecycleChangeInfo.getAction() != null && (lifecycleChangeInfo.getAction() == LifecycleChanceActionEnum.CREATE_FROM_CSAR|| lifecycleChangeInfo.getAction() == LifecycleChanceActionEnum.UPGRADE_MIGRATION)) { return Either.left(true); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java index f0b369072e..e478bc6924 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java @@ -207,7 +207,7 @@ public class LifecycleBusinessLogic { LifecycleStateEnum resourceCurrState = component.getLifecycleState(); // lock resource - if (inTransaction == false && needLock) { + if (!inTransaction && needLock) { log.info("lock component {}", componentId); Either eitherLockResource = lockComponent(componentType, component); if (eitherLockResource.isRight()) { @@ -216,7 +216,7 @@ public class LifecycleBusinessLogic { log.error("lock component {} failed", componentId); return Either.right(errorResponse); } - log.info("after lock component {}", componentId); + log.debug("after lock component {}", componentId); } try { Either commentValidationResult = validateComment(changeInfo, transitionEnum); @@ -228,12 +228,12 @@ public class LifecycleBusinessLogic { return Either.right(errorResponse); } changeInfo.setUserRemarks(commentValidationResult.left().value()); - log.info("after validate component"); + log.debug("after validate component"); Either validateHighestVersion = validateHighestVersion(modifier, lifeCycleTransition, component, resourceCurrVersion, componentType); if (validateHighestVersion.isRight()) { return Either.right(validateHighestVersion.right().value()); } - log.info("after validate Highest Version"); + log.debug("after validate Highest Version"); if (isComponentVFCMT(component,componentType)){ Either changeVFCMTStateResponse = changeVFCMTState(componentType, modifier, transitionEnum, changeInfo, inTransaction, component); if (changeVFCMTStateResponse.isRight()){ @@ -243,11 +243,11 @@ public class LifecycleBusinessLogic { return changeState(component, lifeCycleTransition, componentType, modifier, changeInfo, inTransaction); } finally { - log.info("unlock component {}", componentId); - if (inTransaction == false && needLock && component != null) { - component.setUniqueId(componentId); + component.setUniqueId(componentId); + if (!inTransaction && needLock) { + log.info("unlock component {}", componentId); NodeTypeEnum nodeType = componentType.getNodeType(); - log.info("During change state, another component {} has been created/updated", componentId); + log.info("During change state, another component {} has been created/updated", componentId); graphLockOperation.unlockComponent(componentId, nodeType); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleChangeInfoWithAction.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleChangeInfoWithAction.java index 170e187f15..5d8b29ecdc 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleChangeInfoWithAction.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleChangeInfoWithAction.java @@ -23,7 +23,7 @@ package org.openecomp.sdc.be.components.lifecycle; public class LifecycleChangeInfoWithAction extends LifecycleChangeInfoBase { public enum LifecycleChanceActionEnum { - CREATE_FROM_CSAR, UPDATE_FROM_EXTERNAL_API + CREATE_FROM_CSAR, UPDATE_FROM_EXTERNAL_API, UPGRADE_MIGRATION }; private LifecycleChanceActionEnum action; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/StartCertificationTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/StartCertificationTransition.java index 24266521c2..b74ae5d8e5 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/StartCertificationTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/StartCertificationTransition.java @@ -20,7 +20,8 @@ package org.openecomp.sdc.be.components.lifecycle; -import fj.data.Either; +import java.util.Arrays; + import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -43,7 +44,7 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Arrays; +import fj.data.Either; public class StartCertificationTransition extends LifeCycleTransition { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java index 277cd173aa..324e46016f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.components.lifecycle; import java.util.Arrays; + import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogic.java new file mode 100644 index 0000000000..9c140b36c7 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogic.java @@ -0,0 +1,36 @@ +package org.openecomp.sdc.be.components.merge; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.openecomp.sdc.be.components.impl.BaseBusinessLogic; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.springframework.stereotype.Component; + +import fj.data.Either; + +@Component +public class GlobalInputsFilteringBusinessLogic extends BaseBusinessLogic { + + @javax.annotation.Resource + private GenericTypeBusinessLogic genericTypeBusinessLogic; + + Either, ActionStatus> filterGlobalInputs(Resource newResource) { + Either genericComp = toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(newResource.fetchGenericTypeToscaNameFromConfig()); + return genericComp.bimap(genericResource -> findCommonInputs(genericResource, newResource), + storageOperationStatus -> componentsUtils.convertFromStorageResponse(storageOperationStatus)); + } + + private List findCommonInputs(Resource genericResource, Resource resource) { + List resourceInputs = resource.getInputs(); + List genericInputs = genericTypeBusinessLogic.generateInputsFromGenericTypeProperties(genericResource); + Set genericInputsNames = genericInputs.stream().map(InputDefinition::getName).collect(Collectors.toSet()); + return resourceInputs.stream().filter(input -> genericInputsNames.contains(input.getName())).collect(Collectors.toList()); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogic.java new file mode 100644 index 0000000000..eb359e949e --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogic.java @@ -0,0 +1,41 @@ +package org.openecomp.sdc.be.components.merge; + +import java.util.List; + +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.components.merge.resource.MergeResourceBusinessLogic; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import fj.data.Either; + +@Component +public class GlobalTypesMergeBusinessLogic implements MergeResourceBusinessLogic { + + private static final Logger LOGGER = LoggerFactory.getLogger(GlobalTypesMergeBusinessLogic.class); + + @javax.annotation.Resource + private GlobalInputsFilteringBusinessLogic globalInputsFilteringBusinessLogic; + + @javax.annotation.Resource + private ComponentInputsMergeBL inputsValuesMergeBL; + + @Override + public ActionStatus mergeResourceEntities(Resource oldResource, Resource newResource) { + if (oldResource == null) { + return ActionStatus.OK; + } + Either, ActionStatus> globalInputsEither = globalInputsFilteringBusinessLogic.filterGlobalInputs(newResource); + if (globalInputsEither.isRight()) { + LOGGER.error("failed to get global inputs of resource {} status is {}", newResource.getUniqueId(), globalInputsEither.right().value()); + return globalInputsEither.right().value(); + } + List globalInputs = globalInputsEither.left().value(); + return inputsValuesMergeBL.mergeComponentInputs(oldResource, newResource, globalInputs); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/RelationsComparator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/RelationsComparator.java new file mode 100644 index 0000000000..6c20e501f9 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/RelationsComparator.java @@ -0,0 +1,95 @@ +package org.openecomp.sdc.be.components.merge; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.RelationshipInfo; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.Resource; +import org.springframework.stereotype.Component; + +@Component +public class RelationsComparator { + + /** + * + * @param oldResource the old resource + * @param newResource the new resource + * @return true if there was a change in one of the relations between the old and new resource + * a change in relation is determine by comparing the relations type, node, capability and requirement name + */ + public boolean isRelationsChanged(Resource oldResource, Resource newResource) { + Map> oldRelationsByInstance = oldResource.groupRelationsByInstanceName(oldResource); + Map> newRelationsByInstance = newResource.groupRelationsByInstanceName(newResource); + for (Map.Entry> relationByInst : newRelationsByInstance.entrySet()) { + List oldRelations = oldRelationsByInstance.get(relationByInst.getKey()); + List newRelations = relationByInst.getValue(); + if (isInstanceRelationsChanged(oldResource, oldRelations, newResource, newRelations)) { + return true; + } + } + return false; + + } + + private boolean isInstanceRelationsChanged(Resource oldResource, List oldRelations, Resource newResource, List newRelations) { + if (oldRelations == null || oldRelations.size() != newRelations.size()){ + return true; + } + return newRelations.stream().anyMatch(newRelation -> !findRelation(oldResource, oldRelations, newResource, newRelation)); + } + + + + private boolean findRelation(Resource oldResource, List oldRelations, Resource newResource, RequirementCapabilityRelDef newRelation) { + for (RequirementCapabilityRelDef oldRelation : oldRelations) { + RelationshipInfo oldRelationship = oldRelation.getSingleRelationship().getRelation(); + RelationshipInfo newRelationship = newRelation.getSingleRelationship().getRelation(); + if (oldRelationship != null && newRelationship != null && isRelationEqual(oldRelationship, newRelationship) && isRelationToNodeEquals(oldResource, oldRelation, newResource, newRelation)) { + return true; + } + } + return false; + } + + private boolean isRelationToNodeEquals(Resource oldResource, RequirementCapabilityRelDef oldRelation, Resource newResource, RequirementCapabilityRelDef newRelation) { + String oldToNodeId = oldRelation.getToNode(); + String newToNodeId = newRelation.getToNode(); + Optional oldRelationToNode = oldResource.getComponentInstanceById(oldToNodeId); + Optional newRelationToNode = newResource.getComponentInstanceById(newToNodeId); + return oldRelationToNode.isPresent() && newRelationToNode.isPresent() && oldRelationToNode.get().getName().equals(newRelationToNode.get().getName()); + } + + private boolean isRelationEqual(RelationshipInfo oldRelationship, RelationshipInfo newRelationship) { + return isRelationshipTypeEquals(oldRelationship, newRelationship) && + isRelationshipCapabilityEquals(oldRelationship, newRelationship) && + isRelationshipReqNameEquals(oldRelationship, newRelationship); + } + + private boolean isRelationshipCapabilityEquals(RelationshipInfo oldRelationship, RelationshipInfo newRelationship) { + if(oldRelationship.getCapabilityUid() !=null && newRelationship.getCapabilityUid() != null){ + return oldRelationship.getCapabilityUid().equals(newRelationship.getCapabilityUid()); + } + else if(oldRelationship.getCapabilityUid() == null && newRelationship.getCapabilityUid() == null){ + return true; + } + return false; + } + + private boolean isRelationshipTypeEquals(RelationshipInfo oldRelationship, RelationshipInfo newRelationship) { + return oldRelationship.getRelationship().getType().equals(newRelationship.getRelationship().getType()); + } + + private boolean isRelationshipReqNameEquals(RelationshipInfo oldRelationship, RelationshipInfo newRelationship) { + if(oldRelationship.getRequirement() != null && newRelationship.getRequirement() != null){ + return oldRelationship.getRequirement().equals(newRelationship.getRequirement()); + } + else if(oldRelationship.getRequirement() == null && newRelationship.getRequirement() == null){ + return true; + } + return false; + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/TopologyComparator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/TopologyComparator.java new file mode 100644 index 0000000000..8b48b0897a --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/TopologyComparator.java @@ -0,0 +1,105 @@ +package org.openecomp.sdc.be.components.merge; + +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.exception.SdcActionException; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import fj.data.Either; + +@org.springframework.stereotype.Component +public class TopologyComparator { + + public static final Logger LOGGER = LoggerFactory.getLogger(TopologyComparator.class); + + @javax.annotation.Resource + private RelationsComparator relationsComparator; + + @javax.annotation.Resource + private ToscaOperationFacade toscaOperationFacade; + + @javax.annotation.Resource + private ComponentsUtils componentsUtils; + + /** + * + * @param oldResource the old version of the resource of which to check for topology change + * @param newResource the new version of the resource of which to check for topology change + * @return true if there was a topology change between the old resource and new resource or false otherwise + * in case the action to find topology change failed, an appropriate {@link ActionStatus} will be returned + */ + public Either isTopologyChanged(Resource oldResource, Resource newResource) { + List oldInstances = oldResource.getComponentInstances(); + List newInstances = newResource.getComponentInstances(); + if (oldInstances != null && newInstances == null || oldInstances == null && newInstances != null) { + return Either.left(true); + } + if (oldInstances == null && newInstances == null) { + return Either.left(false); + } + Map oldInstancesByName = MapUtil.toMap(oldInstances, ComponentInstance::getName); + Map newInstancesByName = MapUtil.toMap(newInstances, ComponentInstance::getName); + return isTopologyInstancesChanged(oldResource, newResource, oldInstancesByName, newInstancesByName); + } + + private Either isTopologyInstancesChanged(Resource oldResource, Resource newResource, Map oldInstancesByName, Map newInstancesByName) { + try { + boolean isTopologyChanged = isInstanceNamesChanged(oldInstancesByName, newInstancesByName) || + isInstanceTypesChanged(oldInstancesByName, newInstancesByName) || + relationsComparator.isRelationsChanged(oldResource, newResource); + return Either.left(isTopologyChanged); + } catch (SdcActionException e) { + LOGGER.error("failed to merge entities of previous resource %s to current resource %s. reason: %s", oldResource.getUniqueId(), newResource.getUniqueId(), e.getActionStatus(), e); + return Either.right(e.getActionStatus()); + } + } + + private boolean isInstanceTypesChanged(Map oldInstancesByName, Map newInstancesByName) { + for (Map.Entry instanceByName : newInstancesByName.entrySet()) { + ComponentInstance oldInstance = oldInstancesByName.get(instanceByName.getKey()); + if (!isSameToscaTypeOrOriginComponent(oldInstance, instanceByName.getValue())) { + return true; + } + } + return false; + } + + private boolean isInstanceNamesChanged(Map oldInstanceByName, Map newInstancesByName) { + return !oldInstanceByName.keySet().equals(newInstancesByName.keySet()); + } + + private boolean isSameToscaTypeOrOriginComponent(ComponentInstance oldInstance, ComponentInstance newInstance) { + return isSameToscaType(oldInstance, newInstance) || + isSameOriginComponent(oldInstance, newInstance); + } + + private boolean isSameToscaType(ComponentInstance oldInstance, ComponentInstance newInstance) { + return oldInstance.getToscaComponentName().equals(newInstance.getToscaComponentName()); + } + + private boolean isSameOriginComponent(ComponentInstance oldInstance, ComponentInstance newInstance) { + if (oldInstance.getComponentUid().equals(newInstance.getComponentUid())) { + return true; + } + Component oldOriginCmpt = toscaOperationFacade.getToscaElement(oldInstance.getComponentUid()).left().on(storageStatus -> throwSdcActionException(storageStatus, oldInstance)); + Component newOriginCmpt = toscaOperationFacade.getToscaElement(newInstance.getComponentUid()).left().on(storageStatus -> throwSdcActionException(storageStatus, newInstance)); + return oldOriginCmpt.getInvariantUUID().equals(newOriginCmpt.getInvariantUUID()); + } + + private Component throwSdcActionException(StorageOperationStatus storageOperationStatus, ComponentInstance cmptInstance) { + LOGGER.error("failed to fetch origin node type %s for instance %s", cmptInstance.getUniqueId(), cmptInstance.getComponentUid()); + throw new SdcActionException(componentsUtils.convertFromStorageResponse(storageOperationStatus)); + } + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogic.java new file mode 100644 index 0000000000..1e1bc862cf --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogic.java @@ -0,0 +1,64 @@ +package org.openecomp.sdc.be.components.merge.heat; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.HeatParameterDefinition; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +/** + * Created by chaya on 9/14/2017. + */ +@Component +public class HeatEnvArtifactsMergeBusinessLogic { + + public List mergeInstanceHeatEnvArtifacts(List origHeatEnvArtifacts, List newHeatEnvArtifacts) { + Map origArtifactDefinitionByLabel = MapUtil.toMap(origHeatEnvArtifacts, ArtifactDefinition::getArtifactLabel); + List artifactsToUpdate = new ArrayList<>(); + newHeatEnvArtifacts.stream() + .filter(heatEnvArtifact -> origArtifactDefinitionByLabel.containsKey(heatEnvArtifact.getArtifactLabel())) + .forEach(heatEnvArtifact -> { + ArtifactDefinition origHeatEnvArtifact = origArtifactDefinitionByLabel.get(heatEnvArtifact.getArtifactLabel()); + Boolean wasMergedHeatEnvArtifact = mergeHeatEnvArtifactsParameters(heatEnvArtifact, origHeatEnvArtifact); + if (wasMergedHeatEnvArtifact) { + artifactsToUpdate.add(heatEnvArtifact); + } + }); + return artifactsToUpdate; + } + + private Boolean mergeHeatEnvArtifactsParameters(ArtifactDefinition currArtifact, ArtifactDefinition origArtifact) { + List currentHeatEnvParams = currArtifact.getListHeatParameters(); + List origHeatEnvParams = origArtifact.getListHeatParameters(); + boolean wasChanged = false; + + if (CollectionUtils.isEmpty(origHeatEnvParams) || CollectionUtils.isEmpty(currentHeatEnvParams)) { + return false; + } + + Map origHeatParametersByName = MapUtil.toMap(origHeatEnvParams, HeatParameterDefinition::getName); + + for (HeatParameterDefinition currHeatParam : currentHeatEnvParams) { + String paramName = currHeatParam.getName(); + HeatParameterDefinition origHeatParam = origHeatParametersByName.get(paramName); + if (isSameHeatWithDiffValue(origHeatParam, currHeatParam)) { + currHeatParam.setCurrentValue(origHeatParam.getCurrentValue()); + wasChanged = true; + } + } + currArtifact.setListHeatParameters(currentHeatEnvParams); + return wasChanged; + } + + private boolean isSameHeatWithDiffValue(HeatParameterDefinition origHeatParam, HeatParameterDefinition newHeatParam) { + return origHeatParam != null && + origHeatParam.getCurrentValue() != null && + origHeatParam.getType().equals(newHeatParam.getType()) && + !origHeatParam.getCurrentValue().equals(newHeatParam.getCurrentValue()); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBL.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBL.java new file mode 100644 index 0000000000..b8ea5e35c4 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBL.java @@ -0,0 +1,60 @@ +package org.openecomp.sdc.be.components.merge.input; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +@org.springframework.stereotype.Component +public class ComponentInputsMergeBL { + + @javax.annotation.Resource + private InputsValuesMergingBusinessLogic inputsValuesMergingBusinessLogic; + + @javax.annotation.Resource + private ToscaOperationFacade toscaOperationFacade; + + @javax.annotation.Resource + private ComponentsUtils componentsUtils; + + public ActionStatus mergeAndRedeclareComponentInputs(Component prevComponent, Component newComponent, List inputsToMerge) { + mergeInputs(prevComponent, inputsToMerge); + List previouslyDeclaredInputs = inputsValuesMergingBusinessLogic.getPreviouslyDeclaredInputsToMerge(prevComponent, newComponent); + inputsToMerge.addAll(previouslyDeclaredInputs); + return updateInputs(newComponent.getUniqueId(), inputsToMerge); + } + + public ActionStatus mergeComponentInputs(Component prevComponent, Component newComponent, List inputsToMerge) { + mergeInputs(prevComponent, inputsToMerge); + return updateInputs(newComponent.getUniqueId(), inputsToMerge); + } + + public ActionStatus redeclareComponentInputsForInstance(List oldInputs, Component newComponent, String instanceId) { + List previouslyDeclaredInputs = inputsValuesMergingBusinessLogic.getPreviouslyDeclaredInputsToMerge(oldInputs, newComponent, instanceId); + return updateInputs(newComponent.getUniqueId(), previouslyDeclaredInputs); + } + + private void mergeInputs(Component prevComponent, List inputsToMerge) { + Map oldInputsByName = prevComponent.getInputs() == null ? Collections.emptyMap() : MapUtil.toMap(prevComponent.getInputs(), InputDefinition::getName); + Map inputsToMergeByName = MapUtil.toMap(inputsToMerge, InputDefinition::getName); + inputsValuesMergingBusinessLogic.mergeComponentInputs(oldInputsByName, inputsToMergeByName); + } + + private ActionStatus updateInputs(String containerId, List inputsToUpdate) { + Either, StorageOperationStatus> updateInputsEither = toscaOperationFacade.updateInputsToComponent(inputsToUpdate, containerId); + if (updateInputsEither.isRight()) { + return componentsUtils.convertFromStorageResponse(updateInputsEither.right().value()); + } + return ActionStatus.OK; + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java new file mode 100644 index 0000000000..e49d2b2c87 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java @@ -0,0 +1,180 @@ +package org.openecomp.sdc.be.components.merge.input; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang.StringUtils; +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.InputDefinition; + +@org.springframework.stereotype.Component +public class InputsValuesMergingBusinessLogic { + + /** + * Merge old inputs values into the updated inputs + * An input value is merged if the input previous version had a user defined value and its value is empty in current version + * @param oldInputs the currently persisted inputs mapped by their names + * @param updatedInputs the currently being update inputs mapped by their names + */ + public void mergeComponentInputs(Map oldInputs, Map updatedInputs) { + updatedInputs.forEach((inputName, input) -> mergeInputsValues(oldInputs.get(inputName), input)); + } + + /** + * @param oldComponent the old state of {@link Component} that is being updated + * @param newComponent the new state of {@link Component} that is being updated + * @return a list of all inputs that were previously declared and need to be merged to the updating component + * An input needs to merged if a property was declared as an input (by the user) in previous component version and the declared input not exist in new version + */ + public List getPreviouslyDeclaredInputsToMerge(Component oldComponent, Component newComponent) { + if (oldComponent == null || oldComponent.getInputs() == null || newComponent == null ) { + return Collections.emptyList(); + } + Map> getInputProperties = getAllGetInputPropertyData(newComponent); + List inputsToRedeclareData = buildRedeclareInputData(newComponent, getInputProperties); + return findPrevDeclaredInputs(oldComponent.getInputs(), inputsToRedeclareData); + } + + /** + * @param oldInputs list of previous inputs to find inputs to redeclare from + * @param newComponent the new state of {@link Component} that is being updated + * @param instanceId instance id + * @return a list of all inputs that were previously declared and need to be merged to the updating component + * An input needs to merged if an instance property was declared as an input (by the user) in previous component version and the declared input not exist in new version + */ + public List getPreviouslyDeclaredInputsToMerge(List oldInputs, Component newComponent, String instanceId) { + if (oldInputs == null || newComponent == null ) { + return Collections.emptyList(); + } + Map> getInputProperties = getAllGetInputPropertyData(newComponent, instanceId); + List inputsToRedeclareData = buildRedeclareInputData(newComponent, getInputProperties); + return findPrevDeclaredInputs(oldInputs, inputsToRedeclareData); + } + + private List findPrevDeclaredInputs(List oldInputs, List inputsToRedeclareData) { + Map oldInputsById = MapUtil.toMap(oldInputs, InputDefinition::getUniqueId); + List inputsToRedeclare = new ArrayList<>(); + inputsToRedeclareData.forEach(redeclareInputData -> { + List inputDefinitions = prepareInputsForRedeclaration(oldInputsById, redeclareInputData); + inputsToRedeclare.addAll(inputDefinitions); + }); + return inputsToRedeclare; + } + + private List prepareInputsForRedeclaration(Map oldInputsById, RedeclareInputData redeclareInputData) { + List inputsForRedeclaration = redeclareInputData.declaredInputIds.stream().map(oldInputsById::get).collect(Collectors.toList()); + inputsForRedeclaration.forEach(input -> { + input.setPropertyId(redeclareInputData.propertyId); + input.setInstanceUniqueId(redeclareInputData.instanceId); + }); + return inputsForRedeclaration; + } + + private Map> findGetInputPropsDefinitions(Map> instancesPropDefinitions) { + Map> getInputProps = new HashMap<>(); + if (instancesPropDefinitions == null) { + return getInputProps; + } + return instancesPropDefinitions.entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, + entry -> this.filterGetInputProps(entry.getValue()))); + } + + private List filterGetInputProps(List propDefinitions) { + return propDefinitions + .stream() + .filter(PropertyDataDefinition::isGetInputProperty) + .collect(Collectors.toList()); + } + + private void mergeInputsValues(InputDefinition oldInput, InputDefinition updatedInput) { + if (shouldMergeOldValue(oldInput, updatedInput)) { + updatedInput.setDefaultValue(oldInput.getDefaultValue()); + } + } + + private boolean shouldMergeOldValue(InputDefinition oldInput, InputDefinition newInput) { + return isNonEmptyDefaultValue(oldInput) && isEmptyDefaultValue(newInput) && isSameType(oldInput, newInput); + } + + private boolean isSameType(InputDefinition oldInput, InputDefinition updatedInput) { + return oldInput.typeEquals(updatedInput); + } + + private boolean isEmptyDefaultValue(InputDefinition input) { + return input != null && StringUtils.isEmpty(input.getDefaultValue()); + } + + private boolean isNonEmptyDefaultValue(InputDefinition input) { + return input != null && !isEmptyDefaultValue(input); + } + + private List buildRedeclareInputData(Component newComponent, Map> getInputProperties) { + Map inputsById = MapUtil.toMap(newComponent.getInputs(), InputDefinition::getUniqueId); + List redeclareInputData = new ArrayList<>(); + getInputProperties.forEach((instanceId, getInputProps) -> { + redeclareInputData.addAll(findInputsToRedeclare(inputsById, instanceId, getInputProps)); + }); + return redeclareInputData; + + } + + private Map> getAllGetInputPropertyData(Component newComponent) { + Map> getInputInstanceProps = findGetInputPropsDefinitions(newComponent.getComponentInstancesProperties()); + Map> getInputInstanceInputs = findGetInputPropsDefinitions(newComponent.getComponentInstancesInputs()); + getInputInstanceInputs.putAll(getInputInstanceProps); + return getInputInstanceInputs; + } + + private Map> getAllGetInputPropertyData(Component newComponent, String instanceId) { + List getInputInstanceProps = this.filterGetInputProps(newComponent.safeGetComponentInstanceProperties(instanceId)); + List getInputInstanceInputs = this.filterGetInputProps(newComponent.safeGetComponentInstanceInput(instanceId)); + getInputInstanceInputs.addAll(getInputInstanceProps); + return Collections.singletonMap(instanceId, getInputInstanceInputs); + } + + private List findInputsToRedeclare(Map inputsById, String instanceId, List getInputProps) { + List redeclareInputDataList = new ArrayList<>(); + getInputProps.forEach(property -> { + List inputsToRedeclareIds = findInputsToRedeclareIds(inputsById, property); + RedeclareInputData redeclareInputData = new RedeclareInputData(property.getUniqueId(), inputsToRedeclareIds, instanceId); + redeclareInputDataList.add(redeclareInputData); + }); + return redeclareInputDataList; + } + + private List findInputsToRedeclareIds(Map inputsById, PropertyDataDefinition property) { + List getInputValues = property.getGetInputValues(); + return getInputValues.stream() + .filter(getInputVal -> getInputValueWithNoCorrespondingInput(getInputVal, inputsById)) + .map(GetInputValueDataDefinition::getInputId) + .collect(Collectors.toList()); + } + + private boolean getInputValueWithNoCorrespondingInput(GetInputValueDataDefinition getInputVal, Map inputsById) { + return !inputsById.containsKey(getInputVal.getInputId()); + } + + private class RedeclareInputData { + private String propertyId; + private List declaredInputIds; + private String instanceId; + + public RedeclareInputData(String propertyId, List declaredInputIds, String instanceId) { + this.propertyId = propertyId; + this.declaredInputIds = declaredInputIds; + this.instanceId = instanceId; + } + + } + + +} \ No newline at end of file diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMerge.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMerge.java new file mode 100644 index 0000000000..cac8c977e3 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMerge.java @@ -0,0 +1,101 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Operation; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.exception.ResponseFormat; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; + +/** + * Created by chaya on 9/20/2017. + */ +@org.springframework.stereotype.Component("ComponentInstanceArtifactsMerge") +public class ComponentInstanceArtifactsMerge implements ComponentInstanceMergeInterface { + + @Autowired + ToscaOperationFacade toscaOperationFacade; + + @Autowired + ArtifactsBusinessLogic artifactsBusinessLogic; + + @Override + public void saveDataBeforeMerge(DataForMergeHolder dataHolder, Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent) { + Map componentInstancesDeploymentArtifacts = currentResourceInstance.safeGetDeploymentArtifacts(); + Map originalComponentDeploymentArtifacts = originComponent.getDeploymentArtifacts(); + Map deploymentArtifactsCreatedOnTheInstance = componentInstancesDeploymentArtifacts.entrySet() + .stream() + .filter(i -> !originalComponentDeploymentArtifacts.containsKey(i.getKey())) + .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); + + dataHolder.setOrigComponentDeploymentArtifactsCreatedOnTheInstance(deploymentArtifactsCreatedOnTheInstance); + + Map componentInstancesInformationalArtifacts = currentResourceInstance.safeGetArtifacts(); + Map originalComponentInformationalArtifacts = originComponent.getArtifacts(); + Map informationalArtifactsCreatedOnTheInstance = componentInstancesInformationalArtifacts.entrySet() + .stream() + .filter(i -> !originalComponentInformationalArtifacts.containsKey(i.getKey())) + .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); + dataHolder.setOrigComponentInformationalArtifactsCreatedOnTheInstance(informationalArtifactsCreatedOnTheInstance); + } + + private void addEsIdToArtifactJson(Map artifactJson, String origEsId) { + artifactJson.put(Constants.ARTIFACT_ES_ID, origEsId); + } + + @Override + public Either mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId) { + Map origInstanceDeploymentArtifactsCreatedOnTheInstance = dataHolder.getOrigComponentDeploymentArtifactsCreatedOnTheInstance(); + Map currentInstanceDeploymentArtifacts = updatedContainerComponent.safeGetComponentInstanceDeploymentArtifacts(newInstanceId); + Map filteredDeploymentArtifactsToAdd = Optional.ofNullable(origInstanceDeploymentArtifactsCreatedOnTheInstance).orElse(new HashMap<>()).entrySet().stream() + .filter(artifact -> noArtifactWithTheSameLabel(artifact.getValue().getArtifactLabel(), currentInstanceDeploymentArtifacts)) + .collect(Collectors.toMap(p -> p.getKey(), q -> q.getValue())); + Map origInstanceInformationalArtifactsCreatedOnTheInstance = dataHolder.getOrigComponentInformationalArtifactsCreatedOnTheInstance(); + Map currentInstanceInformationalArtifacts = updatedContainerComponent.safeGetComponentInstanceInformationalArtifacts(newInstanceId); + Map filteredInformationalArtifactsToAdd = Optional.ofNullable(origInstanceInformationalArtifactsCreatedOnTheInstance).orElse(new HashMap<>()).entrySet().stream() + .filter(artifact -> noArtifactWithTheSameLabel(artifact.getValue().getArtifactLabel(), currentInstanceInformationalArtifacts)) + .collect(Collectors.toMap(p -> p.getKey(), q -> q.getValue())); + Map allFilteredArtifactsToAdd = new HashMap<>(); + allFilteredArtifactsToAdd.putAll(filteredDeploymentArtifactsToAdd); + allFilteredArtifactsToAdd.putAll(filteredInformationalArtifactsToAdd); + + for (Map.Entry currentArtifactDefinition : allFilteredArtifactsToAdd.entrySet()) { + Map jsonForUpdateArtifact = artifactsBusinessLogic.buildJsonForUpdateArtifact( + currentArtifactDefinition.getValue().getUniqueId(), currentArtifactDefinition.getValue().getArtifactName(), + currentArtifactDefinition.getValue().getArtifactType(), currentArtifactDefinition.getValue().getArtifactGroupType(), + currentArtifactDefinition.getValue().getArtifactLabel(), currentArtifactDefinition.getValue().getArtifactDisplayName(), + currentArtifactDefinition.getValue().getDescription(), currentArtifactDefinition.getValue().getPayloadData(), + null, currentArtifactDefinition.getValue().getListHeatParameters()); + addEsIdToArtifactJson(jsonForUpdateArtifact, currentArtifactDefinition.getValue().getEsId()); + Either, ResponseFormat> uploadArtifactToService = + artifactsBusinessLogic.updateResourceInstanceArtifactNoContent(newInstanceId, updatedContainerComponent, + user, jsonForUpdateArtifact, artifactsBusinessLogic.new ArtifactOperationInfo( + false, false, ArtifactsBusinessLogic.ArtifactOperationEnum.Link), currentArtifactDefinition.getValue()); + if (uploadArtifactToService.isRight()) { + return Either.right(uploadArtifactToService.right().value()); + } + toscaOperationFacade.commit(); + } + return Either.left(updatedContainerComponent); + } + + private boolean noArtifactWithTheSameLabel(String artifactLabel, Map currDeploymentArtifacts) { + for (Map.Entry artifact : currDeploymentArtifacts.entrySet()) { + if (artifact.getValue().getArtifactLabel().equals(artifactLabel)) { + return false; + } + } + return true; + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMerge.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMerge.java new file mode 100644 index 0000000000..1561cdc797 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMerge.java @@ -0,0 +1,63 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; +import org.openecomp.sdc.be.components.merge.heat.HeatEnvArtifactsMergeBusinessLogic; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Operation; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; + +/** + * Created by chaya on 9/20/2017. + */ +@org.springframework.stereotype.Component("ComponentInstanceHeatEnvMerge") +public class ComponentInstanceHeatEnvMerge implements ComponentInstanceMergeInterface { + + private static Logger log = LoggerFactory.getLogger(ComponentInstanceHeatEnvMerge.class.getName()); + + @Autowired + private ArtifactsBusinessLogic artifactsBusinessLogic; + + @Autowired + private HeatEnvArtifactsMergeBusinessLogic heatEnvArtifactsMergeBusinessLogic; + + @Autowired + protected ComponentsUtils componentsUtils; + + + @Override + public void saveDataBeforeMerge(DataForMergeHolder dataHolder, Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent) { + dataHolder.setOrigComponentInstanceHeatEnvArtifacts(containerComponent.safeGetComponentInstanceHeatArtifacts(currentResourceInstance.getUniqueId())); + } + + @Override + public Either mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId) { + List origCompInstHeatEnvArtifacts = dataHolder.getOrigComponentInstanceHeatEnvArtifacts(); + List newCompInstHeatEnvArtifacts = updatedContainerComponent.safeGetComponentInstanceHeatArtifacts(newInstanceId); + List artifactsToUpdate = heatEnvArtifactsMergeBusinessLogic.mergeInstanceHeatEnvArtifacts(origCompInstHeatEnvArtifacts, newCompInstHeatEnvArtifacts); + + for (ArtifactDefinition artifactInfo : artifactsToUpdate) { + Map json = artifactsBusinessLogic.buildJsonForUpdateArtifact(artifactInfo, ArtifactGroupTypeEnum.DEPLOYMENT, null); + + Either, ResponseFormat> uploadArtifactToService = artifactsBusinessLogic.updateResourceInstanceArtifactNoContent(newInstanceId, updatedContainerComponent, user, json, + artifactsBusinessLogic.new ArtifactOperationInfo(false, false, ArtifactsBusinessLogic.ArtifactOperationEnum.Update), null); + if (uploadArtifactToService.isRight()) { + log.error("Failed to update artifact {} on resourceInstance {}", artifactInfo.getArtifactLabel(), newInstanceId); + return Either.right(uploadArtifactToService.right().value()); + } + } + return Either.left(updatedContainerComponent); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java new file mode 100644 index 0000000000..04af6b7fc0 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java @@ -0,0 +1,90 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import java.util.List; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; +/** + * Created by chaya on 9/12/2017. + */ +@org.springframework.stereotype.Component("componentInstanceMergeDataBusinessLogic") +public class ComponentInstanceMergeDataBusinessLogic { + + private static Logger log = LoggerFactory.getLogger(ComponentInstanceMergeDataBusinessLogic.class.getName()); + + @Autowired + private List componentInstancesMergeBLs; + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + + @Autowired + private ComponentsUtils componentsUtils; + + //for testing only + protected void setComponentInstancesMergeBLs(List componentInstancesMergeBLs) { + this.componentInstancesMergeBLs = componentInstancesMergeBLs; + } + + /** + * Saves all containerComponents data before deleting, in order to merge once creating a new instance + * @param containerComponent + * @param currentResourceInstance + */ + public DataForMergeHolder saveAllDataBeforeDeleting(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent) { + DataForMergeHolder dataHolder = new DataForMergeHolder(); + for (ComponentInstanceMergeInterface compInstMergeBL : componentInstancesMergeBLs) { + compInstMergeBL.saveDataBeforeMerge(dataHolder, containerComponent, currentResourceInstance, originComponent); + } + return dataHolder; + } + + /** + * Merges inputs and instance inputs/props of the new Container component with the old container component data (before deleting) + * @param containerComponent + * @param newContainerComponentId + * @param newInstanceId + * @return + */ + public Either mergeComponentUserOrigData(User user, DataForMergeHolder dataHolder, org.openecomp.sdc.be.model.Component containerComponent, String newContainerComponentId, String newInstanceId) { + + Either componentWithInstancesInputsAndProperties = getComponentWithInstancesInputsAndProperties(newContainerComponentId); + if (componentWithInstancesInputsAndProperties.isRight()) { + log.error("Component with id {} was not found", newContainerComponentId); + StorageOperationStatus storageOperationStatus = componentWithInstancesInputsAndProperties.right().value(); + ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(storageOperationStatus, containerComponent.getComponentType()); + return Either.right(componentsUtils.getResponseFormat(actionStatus)); + } + Component updatedContainerComponent = componentWithInstancesInputsAndProperties.left().value(); + + for (ComponentInstanceMergeInterface compInstMergeBL: componentInstancesMergeBLs) { + Either compInstanceMergeEither = compInstMergeBL.mergeDataAfterCreate(user, dataHolder, updatedContainerComponent, newInstanceId); + if (compInstanceMergeEither.isRight()) { + return Either.right(compInstanceMergeEither.right().value()); + } + } + + return Either.left(updatedContainerComponent); + } + + private Either getComponentWithInstancesInputsAndProperties(String containerComponentId) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreComponentInstancesInputs(false); + filter.setIgnoreComponentInstancesProperties(false); + filter.setIgnoreArtifacts(false); + return toscaOperationFacade.getToscaElement(containerComponentId, filter); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeInterface.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeInterface.java new file mode 100644 index 0000000000..1d2849b94c --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeInterface.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.exception.ResponseFormat; + +import fj.data.Either; + +/** + * Created by chaya on 9/20/2017. + */ +public interface ComponentInstanceMergeInterface { + + void saveDataBeforeMerge(DataForMergeHolder dataHolder, Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent); + + Either mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId); +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMerge.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMerge.java new file mode 100644 index 0000000000..765ddb57f6 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMerge.java @@ -0,0 +1,131 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import java.util.ArrayList; +import java.util.List; + +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstanceInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstancePropertiesMergeBL; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.exception.ResponseFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import fj.data.Either; + +/** + * Created by chaya on 9/20/2017. + */ +@org.springframework.stereotype.Component("ComponentInstancePropsAndInputsMerge") +public class ComponentInstancePropsAndInputsMerge implements ComponentInstanceMergeInterface { + + private static Logger log = LoggerFactory.getLogger(ComponentInstancePropsAndInputsMerge.class.getName()); + + @Autowired + private ToscaOperationFacade toscaOperationFacade; + + @Autowired + private ComponentsUtils componentsUtils; + + @Autowired + private ComponentInstancePropertiesMergeBL componentInstancePropertiesMergeBL; + + @Autowired + private ComponentInstanceInputsMergeBL resourceInstanceInputsMergeBL; + + @Autowired + private ComponentInputsMergeBL resourceInputsMergeBL; + + @Override + public void saveDataBeforeMerge(DataForMergeHolder dataHolder, Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent) { + dataHolder.setOrigComponentInstanceInputs(containerComponent.safeGetComponentInstanceInputsByName(currentResourceInstance.getName())); + dataHolder.setOrigComponentInstanceProperties(containerComponent.safeGetComponentInstanceProperties(currentResourceInstance.getUniqueId())); + dataHolder.setOrigComponentInputs(containerComponent.getInputs()); + } + + @Override + public Either mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId) { + Either, ActionStatus> instanceInputsEither = mergeComponentInstanceInputsIntoContainer(dataHolder, updatedContainerComponent, newInstanceId); + if (instanceInputsEither.isRight()) { + ActionStatus actionStatus = instanceInputsEither.right().value(); + return Either.right(componentsUtils.getResponseFormat(actionStatus)); + } + Either, ActionStatus> instancePropsEither = mergeComponentInstancePropsIntoContainer(dataHolder, updatedContainerComponent, newInstanceId); + if (instancePropsEither.isRight()) { + ActionStatus actionStatus = instancePropsEither.right().value(); + return Either.right(componentsUtils.getResponseFormat(actionStatus)); + } + Either, ActionStatus> inputsEither = mergeComponentInputsIntoContainer(dataHolder, updatedContainerComponent.getUniqueId(), newInstanceId); + if (inputsEither.isRight()) { + ActionStatus actionStatus = inputsEither.right().value(); + return Either.right(componentsUtils.getResponseFormat(actionStatus)); + } + return Either.left(updatedContainerComponent); + } + + private Either, ActionStatus> mergeComponentInstancePropsIntoContainer(DataForMergeHolder dataHolder, Component updatedComponent, String instanceId) { + List originComponentInstanceProps = dataHolder.getOrigComponentInstanceProperties(); + List originComponentsInputs = dataHolder.getOrigComponentInputs(); + List newComponentInstancesProps = updatedComponent.safeGetComponentInstanceProperties(instanceId); + ActionStatus actionStatus = componentInstancePropertiesMergeBL.mergeComponentInstanceProperties(originComponentInstanceProps, originComponentsInputs, updatedComponent, instanceId); + + if (actionStatus != ActionStatus.OK) { + log.error("Failed to update component {} with merged instance properties", updatedComponent.getUniqueId(), newComponentInstancesProps); + return Either.right(actionStatus); + } + return Either.left(newComponentInstancesProps); + } + + private Either, ActionStatus> mergeComponentInstanceInputsIntoContainer(DataForMergeHolder dataHolder, Component updatedComponent, String instanceId) { + List originComponentInstanceInputs = dataHolder.getOrigComponentInstanceInputs(); + List originComponentsInputs = dataHolder.getOrigComponentInputs(); + List newComponentInstancesInputs = updatedComponent.safeGetComponentInstanceInput(instanceId); + ActionStatus actionStatus = resourceInstanceInputsMergeBL.mergeComponentInstanceInputs(originComponentInstanceInputs, originComponentsInputs, updatedComponent, instanceId); + if (actionStatus != ActionStatus.OK) { + log.error("Failed to update component {} with merged instance properties", updatedComponent.getUniqueId(), newComponentInstancesInputs); + return Either.right(actionStatus); + } + return Either.left(newComponentInstancesInputs); + } + + private Either, ActionStatus> mergeComponentInputsIntoContainer(DataForMergeHolder dataHolder, String newContainerComponentId, String newInstanceId) { + List origComponentInputs = dataHolder.getOrigComponentInputs(); + List inputsToAddToContainer = new ArrayList<>(); + if (origComponentInputs != null && !origComponentInputs.isEmpty()) { + // get instance inputs and properties after merge + Either componentWithInstancesInputsAndProperties = getComponentWithInstancesInputsAndProperties(newContainerComponentId); + if (componentWithInstancesInputsAndProperties.isRight()) { + log.error("Component %s was not found", newContainerComponentId); + return Either.right(componentsUtils.convertFromStorageResponse(componentWithInstancesInputsAndProperties.right().value())); + } + Component updatedContainerComponent = componentWithInstancesInputsAndProperties.left().value(); + + ActionStatus redeclareStatus = resourceInputsMergeBL.redeclareComponentInputsForInstance(origComponentInputs, updatedContainerComponent, newInstanceId); + if (redeclareStatus != ActionStatus.OK) { + log.error("Failed to update component {} with merged inputs {}", newContainerComponentId, inputsToAddToContainer); + Either.right(redeclareStatus); + } + } + return Either.left(inputsToAddToContainer); + } + + private Either getComponentWithInstancesInputsAndProperties(String containerComponentId) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + filter.setIgnoreComponentInstancesInputs(false); + filter.setIgnoreComponentInstancesProperties(false); + filter.setIgnoreArtifacts(false); + return toscaOperationFacade.getToscaElement(containerComponentId, filter); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java new file mode 100644 index 0000000000..c5fb1d4a86 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/DataForMergeHolder.java @@ -0,0 +1,114 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.InputDefinition; + +/** + * Created by chaya on 9/7/2017. + */ +public class DataForMergeHolder { + + private List origComponentInstanceInputs; + private List origComponentInstanceProperties; + private List origComponentInputs; + private Map origCompInstDeploymentArtifactsCreatedOnTheInstance; + private Map origCompInstInformationalArtifactsCreatedOnTheInstance; + private List origComponentInstanceHeatEnvArtifacts; + + public DataForMergeHolder() { + origComponentInstanceInputs = new ArrayList<>(); + origComponentInstanceProperties = new ArrayList<>(); + origComponentInputs = new ArrayList<>(); + origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>(); + origCompInstDeploymentArtifactsCreatedOnTheInstance = new HashMap<>(); + + } + + public List getOrigComponentInstanceHeatEnvArtifacts() { + return origComponentInstanceHeatEnvArtifacts; + } + + public void setOrigComponentInstanceHeatEnvArtifacts(List origComponentInstanceHeatEnvArtifacts) { + this.origComponentInstanceHeatEnvArtifacts = origComponentInstanceHeatEnvArtifacts; + } + + public List getOrigComponentInstanceInputs() { + return origComponentInstanceInputs; + } + + public void setOrigComponentInstanceInputs(List origComponentInstanceInputs) { + Optional.ofNullable(origComponentInstanceInputs).orElse(Collections.emptyList()).stream().forEach(input -> { + ComponentInstanceInput copyInput = new ComponentInstanceInput(); + copyInput.setType(input.getType()); + copyInput.setPath(input.getPath()); + copyInput.setRules(input.getRules()); + copyInput.setValueUniqueUid(input.getValueUniqueUid()); + copyInput.setDefaultValue(input.getDefaultValue()); + copyInput.setDescription(input.getDescription()); + copyInput.setGetInputValues(input.getGetInputValues()); + copyInput.setInputId(input.getInputId()); + copyInput.setInputPath(input.getInputPath()); + copyInput.setInputs(input.getInputs()); + copyInput.setLabel(input.getLabel()); + copyInput.setName(input.getName()); + copyInput.setParentUniqueId(input.getParentUniqueId()); + copyInput.setProperties(input.getProperties()); + copyInput.setPropertyId(input.getPropertyId()); + copyInput.setSchema(input.getSchema()); + copyInput.setStatus(input.getStatus()); + copyInput.setDefaultValue(input.getDefaultValue()); + copyInput.setValue(input.getValue()); + this.origComponentInstanceInputs.add(copyInput); + }); + } + + public List getOrigComponentInstanceProperties() { + return origComponentInstanceProperties; + } + + public void setOrigComponentInstanceProperties(List origComponentInstanceProperties) { + Optional.ofNullable(origComponentInstanceProperties).orElse(Collections.emptyList()).stream().forEach(property -> { + ComponentInstanceProperty propertyCopy = new ComponentInstanceProperty(); + propertyCopy.setType(property.getType()); + propertyCopy.setName(property.getName()); + propertyCopy.setValue(property.getValue()); + propertyCopy.setUniqueId(property.getUniqueId()); + propertyCopy.setDefaultValue(property.getDefaultValue()); + propertyCopy.setInputId(property.getInputId()); + propertyCopy.setGetInputValues(property.getGetInputValues()); + this.origComponentInstanceProperties.add(propertyCopy); + }); + } + + public List getOrigComponentInputs() { + return origComponentInputs; + } + + public void setOrigComponentInputs(List origComponentInputs) { + this.origComponentInputs = origComponentInputs; + } + + public Map getOrigComponentDeploymentArtifactsCreatedOnTheInstance(){ return this.origCompInstDeploymentArtifactsCreatedOnTheInstance;} + + public Map getOrigComponentInformationalArtifactsCreatedOnTheInstance(){ return origCompInstInformationalArtifactsCreatedOnTheInstance;} + + public void setOrigComponentDeploymentArtifactsCreatedOnTheInstance(Map origDeploymentArtifacts){ + origCompInstDeploymentArtifactsCreatedOnTheInstance = origDeploymentArtifacts; + } + + public void setOrigComponentInformationalArtifactsCreatedOnTheInstance(Map origInformationalArtifacts){ + origCompInstInformationalArtifactsCreatedOnTheInstance = origInformationalArtifacts; + } + + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComplexPropertyValueMerger.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComplexPropertyValueMerger.java new file mode 100644 index 0000000000..a68e28024c --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComplexPropertyValueMerger.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.List; + +public class ComplexPropertyValueMerger extends PropertyValueMerger { + + private static final ComplexPropertyValueMerger INSTANCE = new ComplexPropertyValueMerger(); + + public static PropertyValueMerger getInstance() { + return INSTANCE; + } + + @Override + Object merge(Object oldVal, Object newVal, List someStrings) { + return mergeValues(oldVal, newVal, someStrings); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBL.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBL.java new file mode 100644 index 0000000000..4e49eef94c --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBL.java @@ -0,0 +1,72 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +@org.springframework.stereotype.Component +public class ComponentInstanceInputsMergeBL { + + @javax.annotation.Resource + private ToscaOperationFacade toscaOperationFacade; + + @javax.annotation.Resource + private ComponentsUtils componentsUtils; + + @javax.annotation.Resource + private DataDefinitionsValuesMergingBusinessLogic propertyValuesMergingBusinessLogic; + + public ActionStatus mergeComponentInstancesInputs(Component oldComponent, Component newComponent) { + Map> componentInstancesInputs = newComponent.getComponentInstancesInputs(); + if (componentInstancesInputs == null) { + return ActionStatus.OK; + } + componentInstancesInputs.forEach((instanceId, instInputs) -> mergeOldInstanceInputsValues(oldComponent, newComponent, instanceId, instInputs)); + return updateComponentInstancesInputs(newComponent, componentInstancesInputs); + } + + public ActionStatus mergeComponentInstanceInputs(List oldInstProps, List oldInputs, Component newComponent, String instanceId) { + List newInstInput = newComponent.safeGetComponentInstanceInput(instanceId); + if (newInstInput == null) { + return ActionStatus.OK; + } + propertyValuesMergingBusinessLogic.mergeInstanceDataDefinitions(oldInstProps, oldInputs, newInstInput, newComponent.getInputs()); + return updateComponentInstanceInputs(newComponent, instanceId, newInstInput); + } + + private ActionStatus updateComponentInstanceInputs(Component newComponent, String instanceId, List newInstInput) { + StorageOperationStatus storageOperationStatus = toscaOperationFacade.updateComponentInstanceInputs(newComponent, instanceId, newInstInput); + if (storageOperationStatus != StorageOperationStatus.OK) { + return componentsUtils.convertFromStorageResponse(storageOperationStatus); + } + return ActionStatus.OK; + } + + private ActionStatus updateComponentInstancesInputs(Component component, Map> componentInstancesInputs) { + Either>, StorageOperationStatus> mapStorageOperationStatusEither = toscaOperationFacade.updateComponentInstanceInputsToComponent(componentInstancesInputs, component.getUniqueId()); + if (mapStorageOperationStatusEither.isRight()) { + return componentsUtils.convertFromStorageResponse(mapStorageOperationStatusEither.right().value()); + } + return ActionStatus.OK; + } + + private void mergeOldInstanceInputsValues(Component oldComponent, Component newComponent, String instanceId, List instInputs) { + ComponentInstance currentCompInstance = newComponent.getComponentInstanceById(instanceId).get(); + List oldInstInputs = oldComponent == null ? Collections.emptyList() : oldComponent.safeGetComponentInstanceInputsByName(currentCompInstance.getName()); + List oldInputs = oldComponent == null ? Collections.emptyList() : oldComponent.getInputs(); + propertyValuesMergingBusinessLogic.mergeInstanceDataDefinitions(oldInstInputs, oldInputs, instInputs, newComponent.getInputs()); + } + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBL.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBL.java new file mode 100644 index 0000000000..43e3ec624a --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBL.java @@ -0,0 +1,73 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +@org.springframework.stereotype.Component +public class ComponentInstancePropertiesMergeBL { + + @javax.annotation.Resource + private ToscaOperationFacade toscaOperationFacade; + + @javax.annotation.Resource(name = "componentUtils") + private ComponentsUtils componentsUtils; + + @javax.annotation.Resource + private DataDefinitionsValuesMergingBusinessLogic propertyValuesMergingBusinessLogic; + + public ActionStatus mergeComponentInstancesProperties(Component oldComponent, Resource newResource) { + Map> newInstProps = newResource.getComponentInstancesProperties(); + if (newInstProps == null) { + return ActionStatus.OK; + } + newInstProps.forEach((instanceId, newProps) -> mergeOldInstancePropertiesValues(oldComponent, newResource, instanceId, newProps) ); + return updateComponentInstancesProperties(newResource, newInstProps); + } + + + public ActionStatus mergeComponentInstanceProperties(List oldInstProps, List oldInputs, Component newComponent, String instanceId) { + List newInstProps = newComponent.safeGetComponentInstanceProperties(instanceId); + if (newInstProps == null) { + return ActionStatus.OK; + } + propertyValuesMergingBusinessLogic.mergeInstanceDataDefinitions(oldInstProps, oldInputs, newInstProps, newComponent.getInputs()); + return updateComponentInstanceProperties(newComponent, instanceId, newInstProps); + } + + private void mergeOldInstancePropertiesValues(Component oldComponent, Component newComponent, String instanceId, List newProps) { + List oldInstProperties = oldComponent == null ? Collections.emptyList() : oldComponent.safeGetComponentInstanceProperties(instanceId); + List oldInputs = oldComponent == null ? Collections.emptyList() : oldComponent.getInputs(); + propertyValuesMergingBusinessLogic.mergeInstanceDataDefinitions(oldInstProperties, oldInputs, newProps, newComponent.getInputs()); + } + + private ActionStatus updateComponentInstancesProperties(Component newComponent, Map> newInstProps) { + Either>, StorageOperationStatus> mapStorageOperationStatusEither = toscaOperationFacade.updateComponentInstancePropsToComponent(newInstProps, newComponent.getUniqueId()); + if (mapStorageOperationStatusEither.isRight()) { + return componentsUtils.convertFromStorageResponse(mapStorageOperationStatusEither.right().value()); + } + return ActionStatus.OK; + } + + private ActionStatus updateComponentInstanceProperties(Component component, String instanceId, List newInstProps) { + StorageOperationStatus storageOperationStatus = toscaOperationFacade.updateComponentInstanceProperties(component, instanceId, newInstProps); + if (storageOperationStatus != StorageOperationStatus.OK) { + return componentsUtils.convertFromStorageResponse(storageOperationStatus); + } + return ActionStatus.OK; + } + + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogic.java new file mode 100644 index 0000000000..96d3bce97e --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogic.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.List; + +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.InputDefinition; +import org.springframework.stereotype.Component; + +@Component +public class DataDefinitionsValuesMergingBusinessLogic { + + @javax.annotation.Resource + private PropertyDataValueMergeBusinessLogic propertyValueMergeBL; + + /** + * Merge previous version data definition values into the new version data definition. + * A data definition value is merged if it had a value in previous version and has no value in the current version. + * in case a property get input value has no corresponding input in the current version its value will not be merged + * @param oldInstanceDataDefinition the currently persisted instance data definitions + * @param oldInputs the previous version inputs + * @param updatedInstanceDataDefinition the currently being update instance data definitions + * @param newInputs the new version inputs + */ + public void mergeInstanceDataDefinitions(List oldInstanceDataDefinition, List oldInputs, List updatedInstanceDataDefinition, List newInputs) { + if (updatedInstanceDataDefinition == null || updatedInstanceDataDefinition.isEmpty() || oldInstanceDataDefinition == null || oldInstanceDataDefinition.isEmpty()) { + return; + } + List mergePropertyData = PropertyInstanceMergeDataBuilder.getInstance().buildDataForMerging(oldInstanceDataDefinition, oldInputs, updatedInstanceDataDefinition, newInputs); + mergePropertyData.forEach(this::mergeInstanceDefinition); + + } + + private void mergeInstanceDefinition(MergePropertyData mergeData) { + if (isSameType(mergeData.getOldProp(), mergeData.getNewProp())) { + propertyValueMergeBL.mergePropertyValue(mergeData.getOldProp(), mergeData.getNewProp(), mergeData.getGetInputNamesToMerge()); + } + } + + private boolean isSameType(PropertyDataDefinition oldDataDefinition, PropertyDataDefinition updatedDataDefinition) { + return oldDataDefinition.typeEquals(updatedDataDefinition); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/MergePropertyData.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/MergePropertyData.java new file mode 100644 index 0000000000..63a7a1b3a0 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/MergePropertyData.java @@ -0,0 +1,52 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.ArrayList; +import java.util.List; + +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; + +/** + * A POJO which represents an instance property data definition (a {@link org.openecomp.sdc.be.model.ComponentInstanceProperty} or {@link org.openecomp.sdc.be.model.ComponentInstanceInput}) + * that its value needs to be merged during an upgrade of a VSP. + * + */ +public class MergePropertyData { + + /*The previous state of the instance property to merge */ + private PropertyDataDefinition oldProp; + /*The new state of the instance property to merge */ + private PropertyDataDefinition newProp; + + private List getInputNamesToMerge = new ArrayList<>(); + + public PropertyDataDefinition getOldProp() { + return oldProp; + } + + public MergePropertyData setOldProp(PropertyDataDefinition oldProp) { + this.oldProp = oldProp; + return this; + } + + public MergePropertyData setNewProp(PropertyDataDefinition newProp) { + this.newProp = newProp; + return this; + } + + public PropertyDataDefinition getNewProp() { + return newProp; + } + + public void addAddGetInputNamesToMerge(List getInputsNameToMerge) { + getInputNamesToMerge.addAll(getInputsNameToMerge); + } + + public List getGetInputNamesToMerge() { + return getInputNamesToMerge; + } + + public boolean isGetInputProp() { + return oldProp.isGetInputProperty(); + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java new file mode 100644 index 0000000000..6b083596c7 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogic.java @@ -0,0 +1,164 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.openecomp.sdc.be.components.impl.ImportUtils; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; +import org.openecomp.sdc.be.model.tosca.ToscaFunctions; +import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; +import org.openecomp.sdc.be.tosca.PropertyConvertor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import com.google.gson.Gson; + +import fj.data.Either; + +@Component +public class PropertyDataValueMergeBusinessLogic { + + private static final Logger LOGGER = LoggerFactory.getLogger(PropertyDataValueMergeBusinessLogic.class); + + private final PropertyConvertor propertyConvertor = PropertyConvertor.getInstance(); + + private PropertyValueMerger complexPropertyValueMerger = ComplexPropertyValueMerger.getInstance(); + + private PropertyValueMerger scalarPropertyValueMerger = ScalarPropertyValueMerger.getInstance(); + + @Resource + private ApplicationDataTypeCache dataTypeCache; + + private final Gson gson = new Gson(); + + /** + * + * @param oldProp the old property to merge value from + * @param newProp the new property to merge value into + * @param getInputNamesToMerge inputs names which their corresponding get_input values are allowed to be merged + */ + public void mergePropertyValue(PropertyDataDefinition oldProp, PropertyDataDefinition newProp, List getInputNamesToMerge) { + Either, TitanOperationStatus> dataTypesEither = dataTypeCache.getAll(); + if (dataTypesEither.isRight()) { + LOGGER.debug("failed to fetch data types, skip merging of previous property values. status: {}", dataTypesEither.right().value()); + } + mergePropertyValue(oldProp, newProp, dataTypesEither.left().value(), getInputNamesToMerge); + mergeComplexPropertyGetInputsValues(oldProp, newProp); + } + + private void mergePropertyValue(PropertyDataDefinition oldProp, PropertyDataDefinition newProp, Map dataTypes, List getInputNamesToMerge) { + Object oldValAsObject = convertPropertyStrValueToObject(oldProp, dataTypes); + Object newValAsObject = convertPropertyStrValueToObject(newProp, dataTypes); + PropertyValueMerger propertyValueMerger = getPropertyValueMerger(newProp); + if(oldValAsObject != null){ + Object mergedValue = propertyValueMerger.mergeValues(oldValAsObject, newValAsObject, getInputNamesToMerge); + newProp.setValue(convertPropertyValueObjectToString(mergedValue)); + } + } + + private PropertyValueMerger getPropertyValueMerger(PropertyDataDefinition newProp) { + if (ToscaPropertyType.isPrimitiveType(newProp.getType()) || ToscaPropertyType.isPrimitiveType(newProp.getSchemaType())) { + return scalarPropertyValueMerger; + } + return complexPropertyValueMerger; + } + + private String convertPropertyValueObjectToString(Object mergedValue) { + if (isEmptyValue(mergedValue)) { + return null; + } + return mergedValue instanceof String? mergedValue.toString() : gson.toJson(mergedValue); + } + + private Object convertPropertyStrValueToObject(PropertyDataDefinition propertyDataDefinition, Map dataTypes) { + String propValue = propertyDataDefinition.getValue() == null ? "": propertyDataDefinition.getValue(); + String propertyType = propertyDataDefinition.getType(); + String innerType = propertyDataDefinition.getSchemaType(); + return propertyConvertor.convertToToscaObject(propertyType, propValue, innerType, dataTypes); + } + + + @SuppressWarnings("unchecked") + private Object removeUnwantedGetInputValues(Object val, List getInputNamesToMerge) { + if (val instanceof Map) { + return removeUnwantedGetInputValues((Map) val, getInputNamesToMerge); + } + if (val instanceof List) { + return removeUnwantedGetInputValues((List)val, getInputNamesToMerge); + } + return val; + } + + private List removeUnwantedGetInputValues(List listVal, List getInputNamesToMerge) { + return listVal.stream().map(val -> removeUnwantedGetInputValues(val, getInputNamesToMerge)).collect(Collectors.toList()); + } + + private Map removeUnwantedGetInputValues(Map val, List getInputNamesToMerge) { + return val.entrySet().stream().filter(entry -> !isGetInputEntry(entry) || isGetInputToMerge(getInputNamesToMerge, entry)) + .collect(Collectors.toMap(Map.Entry::getKey, entry -> removeUnwantedGetInputValues(entry.getValue(), getInputNamesToMerge))); + } + + private boolean isGetInputToMerge(List getInputNamesToMerge, Map.Entry entry) { + return getInputNamesToMerge.contains(retrieveGetInputInputName(entry.getValue())); + } + + private String retrieveGetInputInputName(Object getInputValue) { + return getInputValue instanceof List ? (String)((List) getInputValue).get(0) : (String)getInputValue; + } + + private boolean isGetInputEntry(Map.Entry oldValEntry) { + return oldValEntry.getKey().equals(ImportUtils.ToscaTagNamesEnum.GET_INPUT.getElementName()); + } + + private boolean isEmptyValue(Object val) { + return val == null || + val instanceof Map && ((Map) val).isEmpty() || + val instanceof List && ((List) val).isEmpty(); + } + + private void mergeComplexPropertyGetInputsValues(PropertyDataDefinition oldProp, PropertyDataDefinition newProp) { + if (!oldProp.isGetInputProperty()) { + return; + } + List getInputsToMerge = findOldGetInputValuesToMerge(oldProp, newProp); + List newPropGetInputValues = Optional.ofNullable(newProp.getGetInputValues()).orElse(new ArrayList<>()); + newPropGetInputValues.addAll(getInputsToMerge); + newProp.setGetInputValues(newPropGetInputValues); + } + + private List findOldGetInputValuesToMerge(PropertyDataDefinition oldProp, PropertyDataDefinition newProp) { + List oldGetInputValues = oldProp.getGetInputValues(); + List newGetInputValues = Optional.ofNullable(newProp.getGetInputValues()).orElse(Collections.emptyList()); + List newGetInputNames = newGetInputValues.stream().map(GetInputValueDataDefinition::getInputName).collect(Collectors.toList()); + return oldGetInputValues.stream() + .filter(getInput -> !newGetInputNames.contains(getInput.getInputName())) + .filter(getInput -> isValueContainsGetInput(getInput.getInputName(), newProp.getValue())) + .collect(Collectors.toList()); + } + + private boolean isValueContainsGetInput(String inputName, String value) { + String getInputEntry = "\"%s\":\"%s\""; + return value != null && value.contains(String.format(getInputEntry, ToscaFunctions.GET_INPUT.getFunctionName(), inputName)); + } + + + + + + + + + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java new file mode 100644 index 0000000000..09f26a39ee --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java @@ -0,0 +1,79 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.InputDefinition; + +public class PropertyInstanceMergeDataBuilder { + + private final static PropertyInstanceMergeDataBuilder INSTANCE = new PropertyInstanceMergeDataBuilder(); + + private PropertyInstanceMergeDataBuilder() { + } + + public static PropertyInstanceMergeDataBuilder getInstance() { + return INSTANCE; + } + + public List buildDataForMerging(List oldProps, + List oldInputs, + List newProps, + List newInputs) { + + Map oldPropsByName = MapUtil.toMap(oldProps, T::getName); + Map oldInputsByName = MapUtil.toMap(oldInputs, InputDefinition::getName); + Map newPropsByName = MapUtil.toMap(newProps, T::getName); + Map newInputsByName = MapUtil.toMap(newInputs, InputDefinition::getName); + return buildMergeData(oldPropsByName, oldInputsByName, newPropsByName, newInputsByName); + + } + + private List buildMergeData(Map oldPropsByName, Map oldInputsByName, Map newPropsByName, Map newInputsByName) { + List mergeData = new ArrayList<>(); + newPropsByName.forEach((name, prop) -> { + if (oldPropsByName.containsKey(name)) { + mergeData.add(buildMergePropertyData(oldPropsByName.get(name), oldInputsByName, prop, newInputsByName)); + } + }); + return mergeData; + } + + private MergePropertyData buildMergePropertyData(PropertyDataDefinition oldProp, + Map oldInputsByName, + PropertyDataDefinition newProp, + Map newInputsByName) { + MergePropertyData mergePropertyData = new MergePropertyData(); + mergePropertyData.setOldProp(oldProp) + .setNewProp(newProp); + if (oldProp.isGetInputProperty()) { + setGetInputData(oldProp, oldInputsByName, newInputsByName, mergePropertyData); + + } + return mergePropertyData; + } + + private void setGetInputData(PropertyDataDefinition oldProp, Map oldInputsByName, Map newInputsByName, MergePropertyData mergePropertyData) { + List oldDeclaredByUserInputNames = getOldDeclaredInputsByUser(oldProp.getGetInputValues(), oldInputsByName); + List oldGetInputNamesWhichExistInNewVersion = getOldGetInputNamesWhichExistInNewVersion(oldProp.getGetInputValues(), newInputsByName); + mergePropertyData.addAddGetInputNamesToMerge(oldDeclaredByUserInputNames); + mergePropertyData.addAddGetInputNamesToMerge(oldGetInputNamesWhichExistInNewVersion); + } + + private List getOldGetInputNamesWhichExistInNewVersion(List getInputValues, Map newInputsByName) { + return getInputValues.stream().map(GetInputValueDataDefinition::getInputName).filter(newInputsByName::containsKey).collect(Collectors.toList()); + } + + private List getOldDeclaredInputsByUser(List getInputValues, Map oldInputsByName) { + return getInputValues.stream().map(GetInputValueDataDefinition::getInputName) + .map(oldInputsByName::get) + .filter(oldInput -> oldInput.getInstanceUniqueId() != null) + .map(PropertyDataDefinition::getName) + .collect(Collectors.toList()); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyValueMerger.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyValueMerger.java new file mode 100644 index 0000000000..88601bb521 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyValueMerger.java @@ -0,0 +1,148 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang.StringUtils; +import org.openecomp.sdc.be.components.impl.ImportUtils; + +public abstract class PropertyValueMerger { + + abstract Object merge(Object oldVal, Object newVal, List someStrings); + + @SuppressWarnings("unchecked") + /** + * merges property value oldVal into property value newVal recursively + * @param oldVal - cannot be {@code Null} + */ + protected Object mergeValues(Object oldVal, Object newVal, List getInputNamesToMerge) { + if (isEmptyValue(newVal)) { + return removeUnwantedGetInputValues(oldVal, getInputNamesToMerge); + } + if (isMapTypeValues(oldVal, newVal)) { + return mergeMapValue((Map) oldVal, (Map) newVal, getInputNamesToMerge); + } + if (isListTypeValues(oldVal, newVal)) { + return mergeListValue((List) oldVal, (List) newVal, getInputNamesToMerge); + } + if (isSameTypeValues(oldVal, newVal)) { + return mergeScalarValue(oldVal, newVal); + } + return newVal; + + } + + private Map mergeMapValue(Map oldValMap, Map newValMap, List getInputNamesToMerge) { + mergeEntriesExistInNewValue(oldValMap, newValMap, getInputNamesToMerge);//continue the recursion + setOldEntriesNotExistInNewValue(oldValMap, newValMap, getInputNamesToMerge); + return newValMap; + } + + private void mergeEntriesExistInNewValue(Map oldValMap, Map newValMap, List getInputNamesToMerge) { + for (Map.Entry newValEntry : newValMap.entrySet()) { + Object oldVal = oldValMap.get(newValEntry.getKey()); + if (oldVal != null) { + newValMap.put(newValEntry.getKey(), merge(oldVal, newValEntry.getValue(), getInputNamesToMerge)); + } + } + } + + private void setOldEntriesNotExistInNewValue(Map oldVal, Map newVal, List getInputNamesToMerge) { + for (Map.Entry oldValEntry : oldVal.entrySet()) { + if (!isGetInputEntry(oldValEntry) || isGetInputToMerge(getInputNamesToMerge, oldValEntry)) { + Object oldValObj = oldValEntry.getValue(); + newVal.computeIfAbsent(oldValEntry.getKey(), key -> removeUnwantedGetInputValues(oldValObj, getInputNamesToMerge)); + } + } + } + + private List mergeListValue(List oldVal, List newVal, List getInputNamesToMerge) { + List mergedList = mergeLists(oldVal, newVal, getInputNamesToMerge); + copyRestOfBiggerList(oldVal, newVal, getInputNamesToMerge, mergedList); + return mergedList; + } + + private void copyRestOfBiggerList(List oldVal, List newVal, List getInputNamesToMerge, List mergedList) { + if (oldVal.size() == newVal.size()) { + return; + } + int maxListSize = Math.max(oldVal.size(), newVal.size()); + List greaterList = newVal.size() == maxListSize ? newVal : oldVal; + for (int i = mergedList.size(); i < maxListSize; i ++) { + Object listVal = greaterList.get(i); + Object listValToMerge = greaterList == oldVal ? removeUnwantedGetInputValues(listVal, getInputNamesToMerge) : listVal; + mergedList.add(listValToMerge); + } + } + + private List mergeLists(List oldVal, List newVal, List getInputNamesToMerge) { + int minListSize = Math.min(oldVal.size(), newVal.size()); + List mergedList = new ArrayList<>(); + for (int i = 0; i < minListSize; i++) { + Object mergedVal = merge(oldVal.get(i), newVal.get(i), getInputNamesToMerge); + mergedList.add(mergedVal); + } + return mergedList; + } + + Object mergeScalarValue(Object oldVal, Object newVal) { + return isEmptyValue(newVal) ? oldVal : newVal; + } + + @SuppressWarnings("unchecked") + Object removeUnwantedGetInputValues(Object val, List getInputNamesToMerge) { + if (val instanceof Map) { + return removeUnwantedGetInputValues((Map) val, getInputNamesToMerge); + } + if (val instanceof List) { + return removeUnwantedGetInputValues((List)val, getInputNamesToMerge); + } + return val; + } + + private List removeUnwantedGetInputValues(List listVal, List getInputNamesToMerge) { + return listVal.stream().map(val -> removeUnwantedGetInputValues(val, getInputNamesToMerge)).collect(Collectors.toList()); + } + + private Map removeUnwantedGetInputValues(Map val, List getInputNamesToMerge) { + return val.entrySet().stream().filter(entry -> !isGetInputEntry(entry) || isGetInputToMerge(getInputNamesToMerge, entry)) + .collect(Collectors.toMap(Map.Entry::getKey, entry -> removeUnwantedGetInputValues(entry.getValue(), getInputNamesToMerge))); + } + + private boolean isGetInputToMerge(List getInputNamesToMerge, Map.Entry entry) { + return getInputNamesToMerge.contains(retrieveGetInputInputName(entry.getValue())); + } + + private boolean isMapTypeValues(Object oldVal, Object newVal) { + return newVal instanceof Map && oldVal instanceof Map; + } + + private boolean isListTypeValues(Object oldVal, Object newVal) { + return newVal instanceof List && oldVal instanceof List; + } + + private boolean isSameTypeValues(Object oldVal, Object newVal) { + return oldVal.getClass().equals(newVal.getClass()); + } + + private String retrieveGetInputInputName(Object getInputValue) { + return getInputValue instanceof List ? (String)((List) getInputValue).get(0) : (String)getInputValue; + } + + private boolean isGetInputEntry(Map.Entry oldValEntry) { + return oldValEntry.getKey().equals(ImportUtils.ToscaTagNamesEnum.GET_INPUT.getElementName()); + } + + private boolean isEmptyValue(Object val) { + return val == null || + val instanceof String && StringUtils.isEmpty((String)val) || + val instanceof Map && ((Map) val).isEmpty() || + val instanceof List && ((List) val).isEmpty(); + + + } + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ScalarPropertyValueMerger.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ScalarPropertyValueMerger.java new file mode 100644 index 0000000000..39381e7322 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/ScalarPropertyValueMerger.java @@ -0,0 +1,20 @@ +package org.openecomp.sdc.be.components.merge.property; + +import java.util.List; + +import org.springframework.stereotype.Component; + +@Component("scalar-prop-value-merger") +public class ScalarPropertyValueMerger extends PropertyValueMerger { + + private final static ScalarPropertyValueMerger INSTANCE = new ScalarPropertyValueMerger(); + + public static PropertyValueMerger getInstance() { + return INSTANCE; + } + + @Override + Object merge(Object oldVal, Object newVal, List getInputNamesToMerge) { + return mergeScalarValue(removeUnwantedGetInputValues(oldVal, getInputNamesToMerge), newVal); + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBLFactory.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBLFactory.java new file mode 100644 index 0000000000..9d11eb9aaf --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBLFactory.java @@ -0,0 +1,33 @@ +package org.openecomp.sdc.be.components.merge.resource; + + +import org.openecomp.sdc.be.components.merge.GlobalTypesMergeBusinessLogic; +import org.openecomp.sdc.be.components.merge.TopologyComparator; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.Resource; +import org.springframework.stereotype.Component; + +import fj.data.Either; + +@Component +public class MergeResourceBLFactory { + + @javax.annotation.Resource + private ResourceDataMergeBusinessLogic resourceDataMergeBusinessLogic; + + @javax.annotation.Resource + private GlobalTypesMergeBusinessLogic globalTypesMergeBusinessLogic; + + @javax.annotation.Resource + private TopologyComparator topologyComparator; + + public Either getInstance(Resource oldResource, Resource newResource) { + Either isTopologyChangeEither = topologyComparator.isTopologyChanged(oldResource, newResource); + return isTopologyChangeEither.bimap(this::getInstance, actionStatus -> actionStatus); + } + + private MergeResourceBusinessLogic getInstance(boolean topologyChanged) { + return topologyChanged ? globalTypesMergeBusinessLogic : resourceDataMergeBusinessLogic; + } + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBusinessLogic.java new file mode 100644 index 0000000000..f3bc0c2395 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/MergeResourceBusinessLogic.java @@ -0,0 +1,10 @@ +package org.openecomp.sdc.be.components.merge.resource; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.Resource; + +public interface MergeResourceBusinessLogic { + + ActionStatus mergeResourceEntities(Resource oldResource, Resource newResource); + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogic.java new file mode 100644 index 0000000000..251fb1a64e --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogic.java @@ -0,0 +1,62 @@ +package org.openecomp.sdc.be.components.merge.resource; + +import java.util.ArrayList; +import java.util.List; + +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstanceInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstancePropertiesMergeBL; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Component +public class ResourceDataMergeBusinessLogic implements MergeResourceBusinessLogic { + + private final static Logger log = LoggerFactory.getLogger(ResourceDataMergeBusinessLogic.class.getName()); + + @javax.annotation.Resource + private ComponentInputsMergeBL inputsValuesMergeBL; + + @javax.annotation.Resource + private ComponentInstancePropertiesMergeBL instancePropertiesValueMergeBL; + + @javax.annotation.Resource + private ComponentInstanceInputsMergeBL instanceInputsValueMergeBL; + + @Override + public ActionStatus mergeResourceEntities(Resource oldResource, Resource newResource) { + if (oldResource == null) { + return ActionStatus.OK; + } + + ActionStatus mergeInstInputsStatus = instancePropertiesValueMergeBL.mergeComponentInstancesProperties(oldResource, newResource); + if (mergeInstInputsStatus != ActionStatus.OK) { + log.error("failed to merge instance properties of resource {} status is {}", newResource.getUniqueId(), mergeInstInputsStatus); + return mergeInstInputsStatus; + } + + ActionStatus mergeInstPropsStatus = instanceInputsValueMergeBL.mergeComponentInstancesInputs(oldResource, newResource); + if (mergeInstPropsStatus != ActionStatus.OK) { + log.error("failed to merge instance inputs of resource {} status is {}", newResource.getUniqueId(), mergeInstPropsStatus); + return mergeInstPropsStatus; + } + + ActionStatus mergeInputsStatus = mergeInputs(oldResource, newResource); + if (mergeInputsStatus != ActionStatus.OK) { + log.error("failed to merge inputs of resource {} status is {}", newResource.getUniqueId(), mergeInputsStatus); + return mergeInputsStatus; + } + return ActionStatus.OK; + } + + private ActionStatus mergeInputs(Resource oldResource, Resource newResource) { + List inputsToMerge = newResource.getInputs() != null ? newResource.getInputs() : new ArrayList<>(); + return inputsValuesMergeBL.mergeAndRedeclareComponentInputs(oldResource, newResource, inputsToMerge); + } + + +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java index 7964b4406c..15fff52ab9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java @@ -20,12 +20,12 @@ package org.openecomp.sdc.be.components.validation; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; - import java.util.Optional; import java.util.stream.Collectors; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; + public class ComponentValidations { public static boolean validateComponentInstanceExist(Component component, String instanceId) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/exception/SdcActionException.java b/catalog-be/src/main/java/org/openecomp/sdc/be/exception/SdcActionException.java new file mode 100644 index 0000000000..5c6a437b3d --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/exception/SdcActionException.java @@ -0,0 +1,16 @@ +package org.openecomp.sdc.be.exception; + +import org.openecomp.sdc.be.dao.api.ActionStatus; + +public class SdcActionException extends RuntimeException { + + private ActionStatus actionStatus; + + public SdcActionException(ActionStatus actionStatus) { + this.actionStatus = actionStatus; + } + + public ActionStatus getActionStatus() { + return actionStatus; + } +} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java index 1c2f175cfb..f5fcf628cd 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java @@ -57,6 +57,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -65,8 +67,6 @@ import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - /** * This Servlet serves external users operations on artifacts. * diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java index 8c066c8fde..910521c8dc 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java @@ -21,8 +21,11 @@ package org.openecomp.sdc.be.impl; import java.lang.reflect.Type; -import java.security.cert.CollectionCertStoreParameters; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; import java.util.regex.Pattern; import javax.annotation.PostConstruct; @@ -39,20 +42,28 @@ import org.openecomp.sdc.be.components.impl.ResponseFormatManager; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.graph.datatype.AdditionalInformationEnum; -import org.openecomp.sdc.be.dao.utils.CollectionUtils; import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityTypeDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ConsumerDefinition; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.GroupTypeDefinition; +import org.openecomp.sdc.be.model.PolicyTypeDefinition; +import org.openecomp.sdc.be.model.PropertyConstraint; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintDeserialiser; import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintJacksonDeserialiser; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.tosca.ToscaError; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.common.util.ThreadLocalsHolder; import org.openecomp.sdc.common.util.ValidationUtils; @@ -91,7 +102,6 @@ public class ComponentsUtils { public Either convertJsonToObject(String data, User user, Class clazz, AuditingActionEnum actionEnum) { if (data == null) { - BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeInvalidJsonInput, "convertJsonToObject"); BeEcompErrorManager.getInstance().logBeInvalidJsonInput("convertJsonToObject"); log.debug("object is null after converting from json"); ResponseFormat responseFormat = getInvalidContentErrorAndAudit(user, actionEnum); @@ -102,7 +112,6 @@ public class ComponentsUtils { return Either.left(obj); } catch (Exception e) { // INVALID JSON - BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeInvalidJsonInput, "convertJsonToObject"); BeEcompErrorManager.getInstance().logBeInvalidJsonInput("convertJsonToObject"); log.debug("failed to convert from json {}", data, e); ResponseFormat responseFormat = getInvalidContentErrorAndAudit(user, actionEnum); @@ -134,14 +143,12 @@ public class ComponentsUtils { component = mapper.readValue(data, clazz); if (component == null) { - BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeInvalidJsonInput, "convertJsonToObject"); BeEcompErrorManager.getInstance().logBeInvalidJsonInput("convertJsonToObject"); log.debug("object is null after converting from json"); ResponseFormat responseFormat = getInvalidContentErrorAndAuditComponent(user, actionEnum, typeEnum); return Either.right(responseFormat); } } catch (Exception e) { - BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeInvalidJsonInput, "convertJsonToObject"); BeEcompErrorManager.getInstance().logBeInvalidJsonInput("convertJsonToObject"); log.debug("failed to convert from json {}", data, e); ResponseFormat responseFormat = getInvalidContentErrorAndAuditComponent(user, actionEnum, typeEnum); @@ -160,6 +167,10 @@ public class ComponentsUtils { return responseFormatManager.getResponseFormat(actionStatus, params); } + public ResponseFormat getResponseFormat(StorageOperationStatus storageStatus, String... params) { + return responseFormatManager.getResponseFormat(this.convertFromStorageResponse(storageStatus), params); + } + /** * Returns the response format of resource error with respective variables according to actionStatus. This is needed for cases where actionStatus is anonymously converted from storage operation, and the caller doesn't know what actionStatus he * received. It's caller's Responsibility to fill the resource object passed to this function with needed fields. @@ -238,8 +249,8 @@ public class ComponentsUtils { switch (actionStatus) { case MISSING_CAPABILITY_TYPE: - if (obj instanceof List && org.apache.commons.collections.CollectionUtils.isNotEmpty((List) obj)){ - List list = (List)obj; + if (obj instanceof List && org.apache.commons.collections.CollectionUtils.isNotEmpty((List) obj)){ + List list = (List)obj; if ( list.get(0) instanceof RequirementDefinition ) { responseFormat = getResponseFormat(ActionStatus.MISSING_CAPABILITY_TYPE, ((RequirementDefinition) list.get(0)).getName()); //Arbitray index, all we need is single object return responseFormat; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/DownloadArtifactLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/DownloadArtifactLogic.java index cfa108ed80..ddc5ecabe7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/DownloadArtifactLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/DownloadArtifactLogic.java @@ -43,7 +43,6 @@ import org.openecomp.sdc.be.info.ServletJsonResponse; import org.openecomp.sdc.be.resources.data.ESArtifactData; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.config.EcompErrorName; -import org.openecomp.sdc.common.util.GeneralUtility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfo.java index 163d220871..dfdfeac741 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfo.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfo.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.info; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; public class ArtifactDefinitionInfo { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTemplateInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTemplateInfo.java index 0f1bf4603d..f78b7dfead 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTemplateInfo.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactTemplateInfo.java @@ -27,8 +27,8 @@ import java.util.Map; import java.util.Set; import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -177,13 +177,17 @@ public class ArtifactTemplateInfo { String correctType = type; if (type.equalsIgnoreCase(CSAR_NESTED)) correctType = ArtifactTypeEnum.HEAT_NESTED.getType(); - else if ((type.equalsIgnoreCase(CSAR_VOLUME))) + else if (type.equalsIgnoreCase(CSAR_VOLUME)) correctType = ArtifactTypeEnum.HEAT_VOL.getType(); - else if ((type.equalsIgnoreCase(CSAR_NETWORK))) + else if (type.equalsIgnoreCase(CSAR_NETWORK)) correctType = ArtifactTypeEnum.HEAT_NET.getType(); - else if ((type.equalsIgnoreCase(CSAR_ARTIFACT))) - correctType = ArtifactTypeEnum.HEAT_ARTIFACT.getType(); - else if ((type.equalsIgnoreCase(CSAR_HEAT))) + else if (type.equalsIgnoreCase(CSAR_ARTIFACT)){ + if( parentArtifact != null) + correctType = ArtifactTypeEnum.HEAT_ARTIFACT.getType(); + else + correctType = resourceInfo.type; + } + else if (type.equalsIgnoreCase(CSAR_HEAT)) correctType = ArtifactTypeEnum.HEAT.getType(); else correctType = ArtifactTypeEnum.OTHER.getType(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/GroupDefinitionInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/GroupDefinitionInfo.java index 05af87d789..ea495267bd 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/info/GroupDefinitionInfo.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/GroupDefinitionInfo.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.info; import java.util.List; + import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupInstance; import org.openecomp.sdc.be.model.GroupProperty; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/MergedArtifactInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/MergedArtifactInfo.java index 25b6b3564b..62ee5b6f81 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/info/MergedArtifactInfo.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/MergedArtifactInfo.java @@ -23,14 +23,12 @@ package org.openecomp.sdc.be.info; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map; +import java.util.Optional; import java.util.Set; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.model.ArtifactDefinition; -import java.util.Optional; - public class MergedArtifactInfo { private List createdArtifact; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/listen/BEAppContextListener.java b/catalog-be/src/main/java/org/openecomp/sdc/be/listen/BEAppContextListener.java index fa31989d87..83cda6ef87 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/listen/BEAppContextListener.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/listen/BEAppContextListener.java @@ -20,6 +20,15 @@ package org.openecomp.sdc.be.listen; +import java.io.IOException; +import java.io.InputStream; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.impl.DownloadArtifactLogic; import org.openecomp.sdc.be.impl.WebAppContextWrapper; @@ -29,15 +38,6 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.listener.AppContextListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.web.context.WebApplicationContext; - -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import java.io.IOException; -import java.io.InputStream; -import java.util.jar.Attributes; -import java.util.jar.Manifest; public class BEAppContextListener extends AppContextListener implements ServletContextListener { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java index 15b3eb20c6..ae103dbaca 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AdditionalInformationServlet.java @@ -51,14 +51,14 @@ import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Additional Information Servlet", description = "Additional Information Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java index 7c7da97ef0..5a26b7c4e6 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ArtifactServlet.java @@ -53,14 +53,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - /** * Root resource (exposed at "/" path) */ diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java index 049212dd19..1b02e0afa4 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java @@ -49,14 +49,14 @@ import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - /** * Web Servlet for actions on Attributes * diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java index 4278378bbc..7407a4dff3 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.servlets; -import java.util.EnumMap; import java.util.Map; import java.util.Map.Entry; import java.util.function.Supplier; @@ -57,7 +56,6 @@ import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.config.EcompErrorName; -import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.common.servlets.BasicServlet; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java index 8e08ecf600..81f1775a01 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeMonitoringServlet.java @@ -34,6 +34,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import org.apache.commons.lang3.tuple.Pair; import org.openecomp.sdc.be.components.impl.HealthCheckBusinessLogic; import org.openecomp.sdc.be.components.impl.MonitoringBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -41,8 +42,6 @@ import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.common.monitoring.MonitoringEvent; @@ -54,13 +53,13 @@ import org.springframework.web.context.WebApplicationContext; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.TRACE, trim = false) @Path("/") @Api(value = "BE Monitoring", description = "BE Monitoring") @@ -75,22 +74,20 @@ public class BeMonitoringServlet extends BeGenericServlet { @Path("/healthCheck") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "return aggregate BE health check of Titan, ES and BE", notes = "return BE health check", response = String.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Titan, ES and BE are all up"), @ApiResponse(code = 500, message = "One or more BE components (Titan, ES, BE) are down") }) + @ApiOperation(value = "Return aggregate BE health check of SDC BE components", notes = "return BE health check", response = String.class) + @ApiResponses(value = { @ApiResponse(code = 200, message = "SDC BE components are all up"), @ApiResponse(code = 500, message = "One or more SDC BE components are down") }) public Response getHealthCheck(@Context final HttpServletRequest request) { try { HealthCheckBusinessLogic healthCheckBusinessLogic = getHealthCheckBL(request.getSession().getServletContext()); - List beHealthCheckInfos = healthCheckBusinessLogic.getBeHealthCheckInfosStatus(); - - // List beHealthCheckInfos = - // HealthCheckBusinessLogic.getInstance().getBeHealthCheckInfos(request.getSession().getServletContext()); - ActionStatus status = getAggregateBeStatus(beHealthCheckInfos); + Pair> beHealthCheckInfosStatus = healthCheckBusinessLogic.getBeHealthCheckInfosStatus(); + Boolean aggregateStatus = beHealthCheckInfosStatus.getLeft(); + ActionStatus status = aggregateStatus ? ActionStatus.OK : ActionStatus.GENERAL_ERROR; String sdcVersion = getVersionFromContext(request); if (sdcVersion == null || sdcVersion.isEmpty()) { sdcVersion = "UNKNOWN"; } String siteMode = healthCheckBusinessLogic.getSiteMode(); - HealthCheckWrapper healthCheck = new HealthCheckWrapper(beHealthCheckInfos, sdcVersion, siteMode); + HealthCheckWrapper healthCheck = new HealthCheckWrapper(beHealthCheckInfosStatus.getRight(), sdcVersion, siteMode); // The response can be either with 200 or 500 aggregate status - the // body of individual statuses is returned either way @@ -168,17 +165,6 @@ public class BeMonitoringServlet extends BeGenericServlet { return version; } - private ActionStatus getAggregateBeStatus(List beHealthCheckInfos) { - ActionStatus status = ActionStatus.OK; - for (HealthCheckInfo healthCheckInfo : beHealthCheckInfos) { - if (healthCheckInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN) && healthCheckInfo.getHealthCheckComponent() != HealthCheckComponent.DE) { - status = ActionStatus.GENERAL_ERROR; - break; - } - } - return status; - } - protected MonitoringEvent convertContentToJson(String content, Class clazz) { MonitoringEvent object = null; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java index a89d8b109b..b5971670cf 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentInstanceServlet.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.servlets; import java.io.InputStream; import java.lang.reflect.Type; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -42,6 +43,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; import org.codehaus.jackson.map.ObjectMapper; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.GroupBusinessLogic; @@ -78,12 +80,11 @@ import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; /** - * Root resource (exposed at "/" path) - * .json + * Root resource (exposed at "/" path) .json */ @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") -@Api(value = "Resource Instance Servlet", description = "Resource Instance Servlet") +@Api(value = "Resource Instance Servlet") @Singleton public class ComponentInstanceServlet extends AbstractValidationsServlet { @@ -227,9 +228,6 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { if (convertResponse.isRight()) { // Using both ECOMP error methods, show to Sofer BeEcompErrorManager.getInstance().logBeSystemError("Resource Instance - updateResourceInstance"); - /* - * BeEcompErrorManager.getInstance().processEcompError( EcompErrorName.BeSystemError, "Resource Instance - updateResourceInstance"); - */ log.debug("Failed to convert received data to BE format."); return buildErrorResponse(convertResponse.right().value()); } @@ -358,8 +356,8 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { public Response dissociateRIFromRI( @ApiParam(value = "allowed values are resources /services / products", allowableValues = ComponentTypeEnum.RESOURCE_PARAM_NAME + "," + ComponentTypeEnum.SERVICE_PARAM_NAME + "," + ComponentTypeEnum.PRODUCT_PARAM_NAME, required = true) @PathParam("containerComponentType") final String containerComponentType, - @ApiParam(value = "unique id of the container component") @PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId, @ApiParam(value = "RelationshipInfo", required = true) String data, - @Context final HttpServletRequest request) { + @ApiParam(value = "unique id of the container component") @PathParam("componentId") final String componentId, @HeaderParam(value = Constants.USER_ID_HEADER) String userId, + @ApiParam(value = "RelationshipInfo", required = true) String data, @Context final HttpServletRequest request) { ServletContext context = request.getSession().getServletContext(); String url = request.getMethod() + " " + request.getRequestURI(); @@ -517,7 +515,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { } } - + @POST @Path("/{containerComponentType}/{componentId}/resourceInstance/{componentInstanceId}/input") @Consumes(MediaType.APPLICATION_JSON) @@ -535,8 +533,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { try { Wrapper dataWrapper = new Wrapper<>(); Wrapper errorWrapper = new Wrapper<>(); - Wrapper propertyWrapper = new Wrapper<>(); - + validateInputStream(request, dataWrapper, errorWrapper); ComponentInstanceInput property = null; @@ -544,21 +541,22 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { User modifier = new User(); modifier.setUserId(userId); log.debug("modifier id is {}", userId); - - Either inputEither = getComponentsUtils().convertJsonToObjectUsingObjectMapper(dataWrapper.getInnerElement(), modifier, ComponentInstanceInput.class, AuditingActionEnum.UPDATE_RESOURCE_METADATA, ComponentTypeEnum.SERVICE);; - if(inputEither.isRight()){ + + Either inputEither = getComponentsUtils().convertJsonToObjectUsingObjectMapper(dataWrapper.getInnerElement(), modifier, ComponentInstanceInput.class, AuditingActionEnum.UPDATE_RESOURCE_METADATA, + ComponentTypeEnum.SERVICE); + ; + if (inputEither.isRight()) { log.debug("Failed to convert data to input definition. Status is {}", inputEither.right().value()); return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT)); } property = inputEither.left().value(); - + } if (property == null) { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT)); } - log.debug("Start handle request of updateResourceInstanceProperty. Received property is {}", property); ServletContext context = request.getSession().getServletContext(); @@ -743,7 +741,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { } } - + @POST @Path("/{containerComponentType}/{componentId}/resourceInstance/{componentInstanceId}/groupInstance/{groupInstanceId}/property") @Consumes(MediaType.APPLICATION_JSON) @@ -752,8 +750,8 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { @ApiResponses(value = { @ApiResponse(code = 201, message = "Resource instance created"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 400, message = "Invalid content / Missing content") }) public Response updateGroupInstanceProperty(@ApiParam(value = "service id") @PathParam("componentId") final String componentId, @ApiParam(value = "valid values: resources / services", allowableValues = ComponentTypeEnum.RESOURCE_PARAM_NAME + "," + ComponentTypeEnum.SERVICE_PARAM_NAME) @PathParam("containerComponentType") final String containerComponentType, - @ApiParam(value = "resource instance id") @PathParam("componentInstanceId") final String componentInstanceId, @ApiParam(value = "group instance id") @PathParam("groupInstanceId") final String groupInstanceId, @ApiParam(value = "id of user initiating the operation") @HeaderParam(value = Constants.USER_ID_HEADER) String userId, - @Context final HttpServletRequest request) { + @ApiParam(value = "resource instance id") @PathParam("componentInstanceId") final String componentInstanceId, @ApiParam(value = "group instance id") @PathParam("groupInstanceId") final String groupInstanceId, + @ApiParam(value = "id of user initiating the operation") @HeaderParam(value = Constants.USER_ID_HEADER) String userId, @Context final HttpServletRequest request) { String url = request.getMethod() + " " + request.getRequestURI(); log.debug("Start handle request of {}", url); @@ -803,15 +801,15 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { } } - + @GET @Path("/{containerComponentType}/{componentId}/resourceInstance/{componentInstanceId}/groupInstance/{groupInstId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Get group artifacts ", httpMethod = "GET", notes = "Returns artifacts metadata according to groupInstId", response = Resource.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "group found"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 404, message = "Group not found") }) - public Response getGroupArtifactById(@PathParam("containerComponentType") final String containerComponentType, @PathParam("componentId") final String componentId, @PathParam("componentInstanceId") final String componentInstanceId, @PathParam("groupInstId") final String groupInstId, - @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { + public Response getGroupArtifactById(@PathParam("containerComponentType") final String containerComponentType, @PathParam("componentId") final String componentId, @PathParam("componentInstanceId") final String componentInstanceId, + @PathParam("groupInstId") final String groupInstId, @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { ServletContext context = request.getSession().getServletContext(); String url = request.getMethod() + " " + request.getRequestURI(); log.debug("(GET) Start handle request of {}", url); @@ -836,22 +834,17 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { } } - - //US831698 + + // US831698 @GET @Path("/{containerComponentType}/{containerComponentId}/componentInstances/{componentInstanceUniqueId}/properties") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get component instance properties", httpMethod = "GET", - notes = "Returns component instance properties", response = Response.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Properties found"), - @ApiResponse(code = 403, message = "Restricted operation"), - @ApiResponse(code = 404, message = "Component/Component Instance - not found") }) - public Response getInstancePropertiesById(@PathParam("containerComponentType") final String containerComponentType, - @PathParam("containerComponentId") final String containerComponentId, - @PathParam("componentInstanceUniqueId") final String componentInstanceUniqueId, - @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { - + @ApiOperation(value = "Get component instance properties", httpMethod = "GET", notes = "Returns component instance properties", response = Response.class) + @ApiResponses(value = { @ApiResponse(code = 200, message = "Properties found"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 404, message = "Component/Component Instance - not found") }) + public Response getInstancePropertiesById(@PathParam("containerComponentType") final String containerComponentType, @PathParam("containerComponentId") final String containerComponentId, + @PathParam("componentInstanceUniqueId") final String componentInstanceUniqueId, @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { + ServletContext context = request.getSession().getServletContext(); String url = request.getMethod() + " " + request.getRequestURI(); log.debug("(GET) Start handle request of {}", url); @@ -859,19 +852,15 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { try { ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType); ComponentInstanceBusinessLogic componentInstanceBL = getComponentInstanceBL(context, componentTypeEnum); - - Either, ResponseFormat> componentInstancePropertiesById = componentInstanceBL - .getComponentInstancePropertiesById(containerComponentType, containerComponentId, - componentInstanceUniqueId, userId); + + Either, ResponseFormat> componentInstancePropertiesById = componentInstanceBL.getComponentInstancePropertiesById(containerComponentType, containerComponentId, componentInstanceUniqueId, userId); if (componentInstancePropertiesById.isRight()) { - log.debug("Failed to get properties of component instance ID: {} in {} with ID: {}", - componentInstanceUniqueId, containerComponentType, containerComponentId); + log.debug("Failed to get properties of component instance ID: {} in {} with ID: {}", componentInstanceUniqueId, containerComponentType, containerComponentId); return buildErrorResponse(componentInstancePropertiesById.right().value()); } - return buildOkResponse(getComponentsUtils(). - getResponseFormat(ActionStatus.OK), componentInstancePropertiesById.left().value()); + return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), componentInstancePropertiesById.left().value()); } catch (Exception e) { BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getGroupArtifactById"); log.debug("getGroupArtifactById unexpected exception", e); @@ -879,7 +868,102 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { } } - + + // US330353 + @GET + @Path("/{containerComponentType}/{containerComponentId}/componentInstances/{componentInstanceUniqueId}/capability/{capabilityType}/capabilityName/{capabilityName}/properties") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Get component instance capability properties", httpMethod = "GET", notes = "Returns component instance capability properties", response = Response.class) + @ApiResponses(value = { @ApiResponse(code = 200, message = "Properties found"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 404, message = "Component/Component Instance/Capability - not found") }) + public Response getInstanceCapabilityPropertiesById(@PathParam("containerComponentType") final String containerComponentType, @PathParam("containerComponentId") final String containerComponentId, + @PathParam("componentInstanceUniqueId") final String componentInstanceUniqueId, @PathParam("capabilityType") final String capabilityType, @PathParam("capabilityName") final String capabilityName, @Context final HttpServletRequest request, + @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { + + ServletContext context = request.getSession().getServletContext(); + String url = request.getMethod() + " " + request.getRequestURI(); + log.debug("(GET) Start handle request of {}", url); + + try { + ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType); + ComponentInstanceBusinessLogic componentInstanceBL = getComponentInstanceBL(context, componentTypeEnum); + + Either, ResponseFormat> componentInstancePropertiesById = componentInstanceBL.getComponentInstanceCapabilityPropertiesById(containerComponentType, containerComponentId, componentInstanceUniqueId, + capabilityType, capabilityName, userId); + + if (componentInstancePropertiesById.isRight()) { + log.debug("Failed to get properties of component instance ID: {} in {} with ID: {}", componentInstanceUniqueId, containerComponentType, containerComponentId); + return buildErrorResponse(componentInstancePropertiesById.right().value()); + } + + return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), componentInstancePropertiesById.left().value()); + } catch (Exception e) { + BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getGroupArtifactById"); + log.debug("getGroupArtifactById unexpected exception", e); + return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + + } + + private Either, ResponseFormat> convertMultipleProperties(String dataList) { + if (StringUtils.isEmpty(dataList)) { + return Either.right(getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT)); + } + Either convertStatus = getComponentsUtils().convertJsonToObjectUsingObjectMapper(dataList, new User(), ComponentInstanceProperty[].class, null, ComponentTypeEnum.RESOURCE_INSTANCE); + if (convertStatus.isRight()) { + return Either.right(convertStatus.right().value()); + } + return Either.left(Arrays.asList(convertStatus.left().value())); + } + + //US 331281 + @PUT + @Path("/{containerComponentType}/{containerComponentId}/componentInstances/{componentInstanceUniqueId}/capability/{capabilityType}/capabilityName/{capabilityName}/properties") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Update Instance Capabilty Property", httpMethod = "PUT", notes = "Returns updated property", response = Response.class) + @ApiResponses(value = { @ApiResponse(code = 200, message = "Resource instance capabilty property updated"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 400, message = "Invalid content / Missing content"), + @ApiResponse(code = 404, message = "Component/Component Instance/Capability - not found") }) + public Response updateInstanceCapabilityProperty(@PathParam("containerComponentType") final String containerComponentType, @PathParam("containerComponentId") final String containerComponentId, + @PathParam("componentInstanceUniqueId") final String componentInstanceUniqueId, @PathParam("capabilityType") final String capabilityType, @PathParam("capabilityName") final String capabilityName, + @ApiParam(value = "Instance capabilty property to update", required = true) String data, @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { + ServletContext context = request.getSession().getServletContext(); + String url = request.getMethod() + " " + request.getRequestURI(); + log.debug("(PUT) Start handle request of {}", url); + try { + Wrapper errorWrapper = new Wrapper<>(); + List propertiesToUpdate = new ArrayList<>(); + if (errorWrapper.isEmpty()) { + Either, ResponseFormat> propertiesToUpdateEither = convertMultipleProperties(data); + if (propertiesToUpdateEither.isRight()) { + errorWrapper.setInnerElement(propertiesToUpdateEither.right().value()); + } else { + propertiesToUpdate = propertiesToUpdateEither.left().value(); + } + } + + if (!errorWrapper.isEmpty()) { + return buildErrorResponse(errorWrapper.getInnerElement()); + } + + ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType); + ComponentInstanceBusinessLogic componentInstanceBL = getComponentInstanceBL(context, componentTypeEnum); + + Either, ResponseFormat> updateCICapProperty = componentInstanceBL.updateInstanceCapabilityProperties(componentTypeEnum, containerComponentId, componentInstanceUniqueId, capabilityType, capabilityName, propertiesToUpdate, userId); + + if (updateCICapProperty.isRight()) { + log.debug("Failed to get properties of component instance ID: {} in {} with ID: {}", componentInstanceUniqueId, containerComponentType, containerComponentId); + return buildErrorResponse(updateCICapProperty.right().value()); + } + + return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), updateCICapProperty.left().value()); + } catch (Exception e) { + BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getGroupArtifactById"); + log.debug("getGroupArtifactById unexpected exception", e); + return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + } + @POST @Path("/{containerComponentType}/{containerComponentId}/serviceProxy") @Consumes(MediaType.APPLICATION_JSON) @@ -897,7 +981,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { ComponentInstance componentInstance = RepresentationUtils.fromRepresentation(data, ComponentInstance.class); componentInstance.setInvariantName(null); ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType); - if(componentTypeEnum != ComponentTypeEnum.SERVICE){ + if (componentTypeEnum != ComponentTypeEnum.SERVICE) { log.debug("Unsupported container component type {}", containerComponentType); return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.UNSUPPORTED_ERROR, containerComponentType)); } @@ -919,7 +1003,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); } } - + @DELETE @Path("/{containerComponentType}/{containerComponentId}/serviceProxy/{serviceProxyId}") @Consumes(MediaType.APPLICATION_JSON) @@ -956,7 +1040,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); } } - + @POST @Path("/{containerComponentType}/{containerComponentId}/serviceProxy/{serviceProxyId}/changeVersion/{newServiceId}") @Consumes(MediaType.APPLICATION_JSON) @@ -981,7 +1065,7 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.UNSUPPORTED_ERROR, containerComponentType)); } Either actionResponse = componentInstanceLogic.changeServiceProxyVersion(containerComponentType, containerComponentId, serviceProxyId, userId); - + if (actionResponse.isRight()) { return buildErrorResponse(actionResponse.right().value()); } @@ -993,11 +1077,50 @@ public class ComponentInstanceServlet extends AbstractValidationsServlet { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); } } + /** + * REST API GET relation by Id + * Allows to get relation contained in specified component according to received Id + * @param containerComponentType + * @param componentId + * @param relationId + * @param request + * @param userId + * @return Response + */ + @GET + @Path("/{containerComponentType}/{componentId}/relationId/{relationId}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Get relation", httpMethod = "GET", notes = "Returns relation metadata according to relationId", response = Resource.class) + @ApiResponses(value = { @ApiResponse(code = 200, message = "relation found"), @ApiResponse(code = 403, message = "Restricted operation"), @ApiResponse(code = 404, message = "Relation not found") }) + public Response getRelationById(@PathParam("containerComponentType") final String containerComponentType, @PathParam("componentId") final String componentId, + @PathParam("relationId") final String relationId, @Context final HttpServletRequest request, @HeaderParam(value = Constants.USER_ID_HEADER) String userId) { + + ServletContext context = request.getSession().getServletContext(); + String url = request.getMethod() + " " + request.getRequestURI(); + log.debug("(GET) Start handle request of {}", url); + try { + ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.findByParamName(containerComponentType); + ComponentInstanceBusinessLogic componentInstanceLogic = getComponentInstanceBL(context, componentTypeEnum); + if (componentInstanceLogic == null) { + log.debug("Unsupported component type {}", containerComponentType); + return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.UNSUPPORTED_ERROR, containerComponentType)); + } + + Either actionResponse = componentInstanceLogic.getRelationById(componentId, relationId, userId, componentTypeEnum); + if (actionResponse.isRight()) { + return buildErrorResponse(actionResponse.right().value()); + } + return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), actionResponse.left().value()); + } catch (Exception e) { + BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getRelationById"); + log.debug("getRelationById unexpected exception", e); + return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); + } + } private Either convertToResourceInstance(String data) { - // Either convertStatus = - // convertJsonToObject(data, ComponentInstance.class); Either convertStatus = getComponentsUtils().convertJsonToObjectUsingObjectMapper(data, new User(), ComponentInstance.class, null, ComponentTypeEnum.RESOURCE_INSTANCE); if (convertStatus.isRight()) { return Either.right(convertStatus.right().value()); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java index dff6cddbbb..0c955f4e5a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ComponentServlet.java @@ -20,11 +20,8 @@ package org.openecomp.sdc.be.servlets; -import java.io.IOException; import java.util.ArrayList; -import java.util.Collection; import java.util.EnumMap; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -44,41 +41,33 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.commons.collections.CollectionUtils; -import org.codehaus.jackson.JsonGenerationException; -import org.codehaus.jackson.map.JsonMappingException; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; -import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datamodel.api.HighestFilterEnum; -import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum; import org.openecomp.sdc.be.model.CapReqDef; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.IComponentInstanceConnectedElement; -import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Component Servlet", description = "Component Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java index c207497a22..943ed59e87 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ConsumerServlet.java @@ -51,14 +51,14 @@ import org.springframework.web.context.WebApplicationContext; import com.google.gson.Gson; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/consumers") @Api(value = "Consumer Servlet", description = "Consumer Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java index f9d6f6c754..4215560020 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java @@ -48,13 +48,13 @@ import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - /** * Root resource (exposed at "/" path) */ diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java index da9b867041..7a42360355 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java @@ -20,8 +20,27 @@ package org.openecomp.sdc.be.servlets; -import com.jcabi.aspects.Loggable; -import fj.data.Either; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.inject.Singleton; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + import org.openecomp.sdc.be.components.clean.ComponentsCleanBusinessLogic; import org.openecomp.sdc.be.components.impl.ElementBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -31,7 +50,12 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.info.ArtifactTypesInfo; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.model.ArtifactType; +import org.openecomp.sdc.be.model.Category; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.PropertyScope; +import org.openecomp.sdc.be.model.Tag; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.GroupingDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; @@ -43,21 +67,15 @@ import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.inject.Singleton; +import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.*; - @Path("/v1/") /**** @@ -467,6 +485,7 @@ public class ElementServlet extends BeGenericServlet { configuration.put("componentTypes", elementBL.getAllComponentTypesParamNames()); configuration.put("roles", elementBL.getAllSupportedRoles()); configuration.put("resourceTypes", resourceTypesMap.left().value()); + configuration.put("environmentContext", ConfigurationManager.getConfigurationManager().getConfiguration().getEnvironmentContext()); return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), configuration); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java index f7e7ae2da1..22391bbdc1 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GroupServlet.java @@ -46,7 +46,6 @@ import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,14 +53,14 @@ import org.slf4j.LoggerFactory; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - /** * Root resource (exposed at "/" path) */ @@ -106,7 +105,7 @@ public class GroupServlet extends AbstractValidationsServlet { return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), actionResponse.left().value()); - } catch (Throwable e) { + } catch (Exception e) { BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getGroupArtifactById"); log.debug("getGroupArtifactById unexpected exception", e); return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java index 448c31cf63..4de5488351 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/InputsServlet.java @@ -30,7 +30,6 @@ import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; -import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; @@ -40,7 +39,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.codehaus.jackson.map.ObjectMapper; -import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.InputsBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -55,21 +53,20 @@ import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.config.EcompErrorName; -import org.openecomp.sdc.common.datastructure.Wrapper; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Input Catalog", description = "Input Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java index 89b73eb3e4..c2d7c2a6a1 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/LifecycleServlet.java @@ -53,14 +53,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Lifecycle Actions Servlet", description = "Lifecycle Actions Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java index 209f38d8a4..c0c987b78a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java @@ -99,7 +99,7 @@ public class ProductServlet extends BeGenericServlet { response = buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.CREATED), result); return response; - } catch (Throwable e) { + } catch (Exception e) { BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeRestApiGeneralError, "Create Product"); BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Create Product"); log.debug("create product failed with error ", e); @@ -141,7 +141,7 @@ public class ProductServlet extends BeGenericServlet { Object product = RepresentationUtils.toRepresentation(actionResponse.left().value()); return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), product); - } catch (Throwable e) { + } catch (Exception e) { BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeRestApiGeneralError, "Get Product"); BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get Product"); log.debug("get product failed with error ", e); @@ -221,7 +221,7 @@ public class ProductServlet extends BeGenericServlet { response = buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), product); return response; - } catch (Throwable e) { + } catch (Exception e) { BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeRestApiGeneralError, "Delete Resource"); BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Delete Resource"); log.debug("delete resource failed with error ", e); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PropertyServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PropertyServlet.java index 04428aaa9a..bc5ad35c8f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PropertyServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/PropertyServlet.java @@ -68,14 +68,14 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Resource Property Servlet", description = "Resource Property Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementsServlet.java index e59987fc55..fb4aba6af7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementsServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/RequirementsServlet.java @@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory; import com.google.gson.JsonSyntaxException; import com.jcabi.aspects.Loggable; + import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java index 35431c710c..3cf2a69fb5 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java @@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; import com.jcabi.aspects.Loggable; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java index 66da1d7150..8aa5093404 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourcesServlet.java @@ -67,14 +67,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Resources Catalog", description = "Resources Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java index f38cd85026..cb90d89ed9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ServiceServlet.java @@ -70,14 +70,14 @@ import org.slf4j.LoggerFactory; import com.google.gson.reflect.TypeToken; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Service Catalog", description = "Service Servlet") @@ -763,7 +763,6 @@ public class ServiceServlet extends AbstractValidationsServlet { } catch (Exception e) { log.error("Failed runnign the command {}", command, e); - e.printStackTrace(); return Either.right(getComponentsUtils().getResponseFormat(ActionStatus.GENERAL_ERROR)); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java index 2e961f294b..3ad15961e7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.servlets; -import java.lang.reflect.Type; import java.util.Map; import javax.inject.Singleton; @@ -40,9 +39,7 @@ import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.PropertyConstraint; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintSerialiser; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.common.datastructure.Wrapper; @@ -51,17 +48,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Types Fetch Servlet", description = "Types Fetch Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java index f96d52adb1..bb0be372bf 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesUploadServlet.java @@ -42,8 +42,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.codehaus.jackson.JsonGenerationException; -import org.codehaus.jackson.map.JsonMappingException; import org.glassfish.jersey.media.multipart.FormDataParam; import org.openecomp.sdc.be.components.impl.CapabilityTypeImportManager; import org.openecomp.sdc.be.components.impl.CategoriesImportManager; @@ -60,22 +58,22 @@ import org.openecomp.sdc.be.model.GroupTypeDefinition; import org.openecomp.sdc.be.model.PolicyTypeDefinition; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.datastructure.Wrapper; import org.openecomp.sdc.common.datastructure.FunctionalInterfaces.ConsumerTwoParam; +import org.openecomp.sdc.common.datastructure.Wrapper; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog/uploadType") @Api(value = "Catalog Types Upload", description = "Upload Type from yaml") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java index 67230470ff..a6f6359ac1 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/UserAdminServlet.java @@ -53,14 +53,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/user") @Api(value = "User Administration", description = "User admininstarator operations") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetector.java b/catalog-be/src/main/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetector.java index 876066b9ba..faebb7614b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetector.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetector.java @@ -34,8 +34,8 @@ import javax.annotation.PreDestroy; import org.apache.commons.codec.binary.Base64; import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.SwitchoverDetectorConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.rest.HttpRestClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java index 41268188f9..886b654b81 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java @@ -1,5 +1,4 @@ /*- - * ============LICENSE_START======================================================= * SDC * ================================================================================ @@ -81,9 +80,7 @@ public class CapabiltyRequirementConvertor { @Autowired private ToscaOperationFacade toscaOperationFacade; - protected CapabiltyRequirementConvertor() { - - } + protected CapabiltyRequirementConvertor() {} public static synchronized CapabiltyRequirementConvertor getInstance() { if (instance == null) { @@ -117,9 +114,8 @@ public class CapabiltyRequirementConvertor { } private void convertOverridenProperties(ComponentInstance componentInstance, Map dataTypes, Map capabilties, CapabilityDefinition c) { - List properties = c.getProperties(); - if (properties != null && !properties.isEmpty()) { - properties + if (CollectionUtils.isNotEmpty(c.getProperties())) { + c.getProperties() .stream() .filter(p -> p.getValue() != null || p.getDefaultValue() != null) .forEach(p -> convertOverridenProperty(componentInstance, dataTypes, capabilties, c, p)); @@ -331,7 +327,9 @@ public class CapabiltyRequirementConvertor { result = Either.right(false); } if(result == null){ - result = buildSubstitutedName(componentsCache, getOriginRes.left().value(), Lists.newArrayList(path.subList(0, path.size()-1)), name); + List reducedPath = getReducedPath(path); + reducedPath.remove(reducedPath.size()-1); + result = buildSubstitutedName(componentsCache, getOriginRes.left().value(), reducedPath, name); } return result; } @@ -432,12 +430,12 @@ public class CapabiltyRequirementConvertor { */ public Either, ToscaError> convertSubstitutionMappingCapabilities(Map componentsCache, Component component) { Map> capabilities = component.getCapabilities(); - Either, ToscaError> res = null; + Either, ToscaError> res; if (capabilities != null) { res = buildAddSubstitutionMappingsCapabilities(componentsCache, component, capabilities); } else { + res = Either.left(Maps.newHashMap()); logger.debug(NO_CAPABILITIES); - res = Either.left(new HashMap<>()); } return res; } @@ -483,7 +481,7 @@ public class CapabiltyRequirementConvertor { toscaCapability.setValid_source_types(c.getValidSourceTypes()); List properties = c.getProperties(); - if (properties != null && !properties.isEmpty()) { + if (CollectionUtils.isNotEmpty(properties)) { Map toscaProperties = new HashMap<>(); for (PropertyDefinition property : properties) { ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(dataTypes, property, true); @@ -493,15 +491,22 @@ public class CapabiltyRequirementConvertor { } toscaCapabilities.put(name, toscaCapability); } - - Either buildSubstitutedName(Map originComponents, Component originComponent, List path, String name) { + /** + * Allows to build substituted name of capability\requirement of the origin component instance according to the path + * @param componentsCache + * @param originComponent + * @param path + * @param name + * @return + */ + public Either buildSubstitutedName(Map componentsCache, Component originComponent, List path, String name) { StringBuilder substitutedName = new StringBuilder(); boolean nameBuiltSuccessfully = true; Either result; if(CollectionUtils.isNotEmpty(path) && !ToscaUtils.isComplexVfc(originComponent)){ - Collections.reverse(path); - Iterator instanceIdIter = path.iterator(); - nameBuiltSuccessfully = appendNameRecursively(originComponents, originComponent, instanceIdIter, substitutedName); + List reducedPath = getReducedPath(path); + Collections.reverse(reducedPath); + nameBuiltSuccessfully = appendNameRecursively(componentsCache, originComponent, reducedPath.iterator(), substitutedName); } if(nameBuiltSuccessfully){ result = Either.left(substitutedName.append(name).toString()); @@ -511,43 +516,57 @@ public class CapabiltyRequirementConvertor { return result; } - private boolean appendNameRecursively(Map originComponents, Component originComponent, Iterator instanceIdIter, StringBuilder substitutedName) { - if(CollectionUtils.isNotEmpty(originComponent.getComponentInstances()) && instanceIdIter.hasNext()){ + private List getReducedPath(List path) { + List pathCopy = Lists.newArrayList(); + path.stream().forEach(id -> {if(!pathCopy.contains(id))pathCopy.add(id);}); + return pathCopy; + } + + private boolean appendNameRecursively(Map componentsCache, Component originComponent, Iterator instanceIdIter, StringBuilder substitutedName) { + if(CollectionUtils.isNotEmpty(originComponent.getComponentInstances()) && instanceIdIter.hasNext() && !ToscaUtils.isComplexVfc(originComponent)){ String instanceId = instanceIdIter.next(); Optional instanceOpt = originComponent.getComponentInstances().stream().filter(i -> i.getUniqueId().equals(instanceId)).findFirst(); if(!instanceOpt.isPresent()){ logger.debug("Failed to find an instance with uniqueId {} on a component with uniqueId {}", instanceId, originComponent.getUniqueId()); return false; } - Either getOriginRes = getOriginComponent(originComponents, instanceOpt.get()); + substitutedName.append(instanceOpt.get().getNormalizedName()).append('.'); + Either getOriginRes = getOriginComponent(componentsCache, instanceOpt.get()); if(getOriginRes.isRight()){ return false; } - appendNameRecursively(originComponents, getOriginRes.left().value(), instanceIdIter, substitutedName); - substitutedName.append(instanceOpt.get().getNormalizedName()).append('.'); - return true; + appendNameRecursively(componentsCache, getOriginRes.left().value(), instanceIdIter, substitutedName); } return true; } - private Either getOriginComponent(Map originComponents, ComponentInstance instance) { + Either getOriginComponent(Map componentsCache, ComponentInstance instance) { Either result; Either getOriginRes; - if(originComponents.containsKey(instance.getComponentUid())){ - result = Either.left(originComponents.get(instance.getComponentUid())); + if(componentsCache.containsKey(instance.getActualComponentUid())){ + result = Either.left(componentsCache.get(instance.getActualComponentUid())); } else { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreComponentInstances(false); - getOriginRes = toscaOperationFacade.getToscaElement(instance.getComponentUid(), filter); + ComponentParametersView filter = getFilter(instance); + getOriginRes = toscaOperationFacade.getToscaElement(instance.getActualComponentUid(), filter); if(getOriginRes.isRight()){ - logger.debug("Failed to get an origin component with uniqueId {}", instance.getComponentUid()); + logger.debug("Failed to get an origin component with uniqueId {}", instance.getActualComponentUid()); result = Either.right(false); } else { result = Either.left(getOriginRes.left().value()); - originComponents.put(getOriginRes.left().value().getUniqueId(), getOriginRes.left().value()); + componentsCache.put(getOriginRes.left().value().getUniqueId(), getOriginRes.left().value()); } } return result; } + private ComponentParametersView getFilter(ComponentInstance instance) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreComponentInstances(false); + if(instance.getIsProxy()){ + filter.setIgnoreCapabilities(false); + filter.setIgnoreRequirements(false); + } + return filter; + } + } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java index 2f4a385f69..f6ae79b26a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java @@ -20,8 +20,26 @@ package org.openecomp.sdc.be.tosca; -import com.google.gson.Gson; -import fj.data.Either; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.output.ByteArrayOutputStream; @@ -61,7 +79,6 @@ import org.openecomp.sdc.be.tosca.model.ToscaTemplate; import org.openecomp.sdc.be.utils.CommonBeUtils; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; -import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.util.GeneralUtility; import org.openecomp.sdc.common.util.ValidationUtils; @@ -75,25 +92,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; +import com.google.gson.Gson; + +import fj.data.Either; /** @@ -254,7 +255,8 @@ public class CsarUtils { String cassandraId = artifactDefinition.getEsId(); Either fromCassandra = getFromCassandra(cassandraId); if (fromCassandra.isRight()) { - ResponseFormat responseFormat = componentsUtils.getResponseFormat(fromCassandra.right().value()); + log.debug("ArtifactName {}, unique ID {}", artifactDefinition.getArtifactName(), artifactDefinition.getUniqueId()); + ResponseFormat responseFormat = componentsUtils.getResponseFormat(fromCassandra.right().value()); return Either.right(responseFormat); } mainYaml = fromCassandra.left().value(); @@ -328,6 +330,12 @@ public class CsarUtils { // add component to zip Either entryData = getEntryData(innerComponentTriple.getLeft(), innerComponent); + if (entryData.isRight()) { + ResponseFormat responseFormat = componentsUtils.getResponseFormat(entryData.right().value()); + log.debug("Failed adding to zip component {}, error {}", innerComponentTriple.getLeft(), + entryData.right().value()); + return Either.right(responseFormat); + } byte[] content = entryData.left().value(); zip.putNextEntry(new ZipEntry(DEFINITIONS_PATH + icFileName)); zip.write(content); @@ -394,7 +402,7 @@ public class CsarUtils { final int initSize = 2048; - log.debug("Starting coppy from Schema file zip to CSAR zip"); + log.debug("Starting copy from Schema file zip to CSAR zip"); try (ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(schemaFileZip)); ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -657,7 +665,7 @@ public class CsarUtils { null, null, user, component, shouldLock, inTransaction, false); if (validateAndHandleArtifact.isRight()) { - if (ArtifactOperationEnum.Create == operationType.getArtifactOperationEnum() || ArtifactOperationEnum.Update == operationType.getArtifactOperationEnum()) { + if (ArtifactOperationEnum.isCreateOrLink(operationType.getArtifactOperationEnum()) || ArtifactOperationEnum.Update == operationType.getArtifactOperationEnum()) { ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.AAI_ARTIFACT_GENERATION_FAILED, componentType.getValue(), component.getName(), validateAndHandleArtifact.right().value().toString()); Either.right(responseFormat); @@ -739,7 +747,7 @@ public class CsarUtils { } else { Either fromCassandra = getFromCassandra(cassandraId); if (fromCassandra.isRight()) { - return Either.right(fromCassandra.right().value()); + return Either.right(fromCassandra.right().value()); } else { content = fromCassandra.left().value(); } @@ -773,19 +781,16 @@ public class CsarUtils { Either artifactResponse = artifactCassandraDao.getArtifact(cassandraId); if (artifactResponse.isRight()) { - log.debug("In createCsar fetching of artifact from CS failed"); - log.debug("Failed to fetch from Cassandra by id {} error {} ", cassandraId, artifactResponse.right().value()); + log.debug("Failed to fetch artifact from Cassandra by id {} error {} ", cassandraId, artifactResponse.right().value()); StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(artifactResponse.right().value()); ActionStatus convertedFromStorageResponse = componentsUtils.convertFromStorageResponse(storageStatus); return Either.right(convertedFromStorageResponse); - } else { - ESArtifactData artifactData = artifactResponse.left().value(); - return Either.left(artifactData.getDataAsArray()); - } + ESArtifactData artifactData = artifactResponse.left().value(); + return Either.left(artifactData.getDataAsArray()); } - + private String createCsarBlock0(String metaFileVersion, String toscaConformanceLevel) { final String BLOCK_0_TEMPLATE = "SDC-TOSCA-Meta-File-Version: %s\nSDC-TOSCA-Definitions-Version: %s\n"; @@ -1201,18 +1206,20 @@ public class CsarUtils { for (ArtifactDefinition artifactDefinition : artifactDefinitionList) { if (!isInCertificationRequest && componentType == ComponentTypeEnum.SERVICE - && artifactDefinition.getArtifactType().equals(heatEnvType)){ + && artifactDefinition.getArtifactType().equals(heatEnvType) || + //this is placeholder + (artifactDefinition.getEsId() == null && artifactDefinition.getMandatory())){ continue; } - String esId = artifactDefinition.getEsId(); byte[] payloadData = artifactDefinition.getPayloadData(); String artifactFileName = artifactDefinition.getArtifactName(); if (payloadData == null) { - Either fromCassandra = getFromCassandra(esId); + Either fromCassandra = getFromCassandra(artifactDefinition.getEsId()); if (fromCassandra.isRight()) { + log.debug("ArtifactName {}, unique ID {}", artifactDefinition.getArtifactName(), artifactDefinition.getUniqueId()); log.debug("Failed to get {} payload from DB reason: {}", artifactFileName, fromCassandra.right().value()); continue; } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java index 22f6730eb1..083ea67769 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java @@ -145,7 +145,7 @@ public class PropertyConvertor { } innerConverter = type.getValueConverter(); - if (ToscaPropertyType.STRING.equals(type) && value.startsWith("/")) { + if (ToscaPropertyType.STRING.equals(type) && valueStartsWithNonJsonChar(value)) { return innerConverter.convertToToscaValue(value, innerType, dataTypes); } } @@ -192,4 +192,8 @@ public class PropertyConvertor { } + private boolean valueStartsWithNonJsonChar(String value) { + return value.startsWith("/") || value.startsWith(":"); + } + } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java index 1f29eb2113..c37c15f694 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java @@ -57,7 +57,7 @@ import org.openecomp.sdc.be.model.GroupInstance; import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -110,7 +110,7 @@ public class ToscaExportHandler { @Autowired private CapabiltyRequirementConvertor capabiltyRequirementConvertor; private PropertyConvertor propertyConvertor = PropertyConvertor.getInstance(); - Map originComponents = new HashMap<>(); + Map originComponents = new HashMap<>(); private static Logger log = LoggerFactory.getLogger(ToscaExportHandler.class.getName()); @@ -127,7 +127,8 @@ public class ToscaExportHandler { public static final String VF_MODULE_TYPE_EXPANSION = "Expansion"; private static final String FAILED_TO_GET_DEFAULT_IMPORTS_CONFIGURATION = "convertToToscaTemplate - failed to get Default Imports section from configuration"; private static final String NOT_SUPPORTED_COMPONENT_TYPE = "Not supported component type {}"; - protected static final List>> DEFAULT_IMPORTS = ConfigurationManager.getConfigurationManager().getConfiguration().getDefaultImports(); + protected static final List>> DEFAULT_IMPORTS = ConfigurationManager + .getConfigurationManager().getConfiguration().getDefaultImports(); public Either exportComponent(Component component) { @@ -229,7 +230,7 @@ public class ToscaExportHandler { return Either.right(importsRes.right().value()); } toscaNode = importsRes.left().value().left; - /*Either, ToscaError> nodeTypesMapEither = createProxyNodeTypes(component); + Either, ToscaError> nodeTypesMapEither = createProxyNodeTypes(component); if (nodeTypesMapEither.isRight()) { log.debug("Failed to fetch normative service proxy resource by tosca name, error {}", nodeTypesMapEither.right().value()); @@ -237,7 +238,7 @@ public class ToscaExportHandler { } Map nodeTypesMap = nodeTypesMapEither.left().value(); if (nodeTypesMap != null && !nodeTypesMap.isEmpty()) - toscaNode.setNode_types(nodeTypesMap);*/ + toscaNode.setNode_types(nodeTypesMap); Map componentCache = importsRes.left().value().right; Either, TitanOperationStatus> dataTypesEither = dataTypeCache.getAll(); @@ -274,8 +275,17 @@ public class ToscaExportHandler { if (groups != null && !groups.isEmpty()) { groupsMap = new HashMap<>(); for (GroupDefinition group : groups) { - ToscaGroupTemplate toscaGroup = convertGroup(group); - groupsMap.put(group.getName(), toscaGroup); + boolean addToTosca = true; + if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) { + List artifacts = group.getArtifacts(); + if (artifacts == null || artifacts.isEmpty()) { + addToTosca = false; + } + } + if (addToTosca) { + ToscaGroupTemplate toscaGroup = convertGroup(group); + groupsMap.put(group.getName(), toscaGroup); + } } log.debug("groups converted"); @@ -343,10 +353,10 @@ public class ToscaExportHandler { private ToscaMetadata convertMetadata(Component component, boolean isInstance, ComponentInstance componentInstance) { ToscaMetadata toscaMetadata = new ToscaMetadata(); - toscaMetadata.setName(component.getComponentMetadataDefinition().getMetadataDataDefinition().getName()); toscaMetadata.setInvariantUUID(component.getInvariantUUID()); toscaMetadata.setUUID(component.getUUID()); toscaMetadata.setDescription(component.getDescription()); + toscaMetadata.setName(component.getComponentMetadataDefinition().getMetadataDataDefinition().getName()); List categories = component.getCategories(); CategoryDefinition categoryDefinition = categories.get(0); @@ -355,11 +365,26 @@ public class ToscaExportHandler { if (isInstance) { toscaMetadata.setVersion(component.getVersion()); toscaMetadata.setCustomizationUUID(componentInstance.getCustomizationUUID()); + if (componentInstance.getSourceModelInvariant() != null + && !componentInstance.getSourceModelInvariant().isEmpty()) { + toscaMetadata.setVersion(componentInstance.getComponentVersion()); + toscaMetadata.setSourceModelInvariant(componentInstance.getSourceModelInvariant()); + toscaMetadata.setSourceModelUuid(componentInstance.getSourceModelUuid()); + toscaMetadata.setSourceModelName(componentInstance.getSourceModelName()); + toscaMetadata.setName( + componentInstance.getSourceModelName() + " " + OriginTypeEnum.ServiceProxy.getDisplayValue()); + toscaMetadata.setDescription(componentInstance.getDescription()); + } + } switch (component.getComponentType()) { case RESOURCE: Resource resource = (Resource) component; - toscaMetadata.setType(resource.getResourceType().name()); + + if (isInstance && componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy) { + toscaMetadata.setType(componentInstance.getOriginType().getDisplayValue()); + } else + toscaMetadata.setType(resource.getResourceType().name()); toscaMetadata.setSubcategory(categoryDefinition.getSubcategories().get(0).getName()); toscaMetadata.setResourceVendor(resource.getVendorName()); toscaMetadata.setResourceVendorRelease(resource.getVendorRelease()); @@ -370,15 +395,16 @@ public class ToscaExportHandler { toscaMetadata.setType(component.getComponentType().getValue()); toscaMetadata.setServiceType(service.getServiceType()); toscaMetadata.setServiceRole(service.getServiceRole()); + toscaMetadata.setEnvironmentContext(service.getEnvironmentContext()); if (!isInstance) { // DE268546 - toscaMetadata.setServiceEcompNaming(((Service)component).isEcompGeneratedNaming()); - toscaMetadata.setEcompGeneratedNaming(((Service)component).isEcompGeneratedNaming()); - toscaMetadata.setNamingPolicy(((Service)component).getNamingPolicy()); + toscaMetadata.setServiceEcompNaming(((Service) component).isEcompGeneratedNaming()); + toscaMetadata.setEcompGeneratedNaming(((Service) component).isEcompGeneratedNaming()); + toscaMetadata.setNamingPolicy(((Service) component).getNamingPolicy()); } break; default: - log.debug("Not supported component type {}", component.getComponentType()); + log.debug(NOT_SUPPORTED_COMPONENT_TYPE, component.getComponentType()); } return toscaMetadata; } @@ -472,7 +498,7 @@ public class ToscaExportHandler { } public static String getInterfaceFilename(String artifactName) { - return artifactName.substring(0, artifactName.lastIndexOf('.')) + ToscaExportHandler.TOSCA_INTERFACE_NAME; + return artifactName.substring(0, artifactName.lastIndexOf('.')) + ToscaExportHandler.TOSCA_INTERFACE_NAME; } private Either convertNodeType(Component component, ToscaTemplate toscaNode, @@ -539,7 +565,8 @@ public class ToscaExportHandler { toscaNodeType = capabilities.left().value(); log.debug("Capabilities converted for {}", component.getUniqueId()); - Either requirements = capabiltyRequirementConvertor.convertRequirements(component, toscaNodeType); + Either requirements = capabiltyRequirementConvertor.convertRequirements(component, + toscaNodeType); if (requirements.isRight()) { return Either.right(requirements.right().value()); } @@ -584,9 +611,15 @@ public class ToscaExportHandler { ToscaNodeTemplate nodeTemplate = new ToscaNodeTemplate(); nodeTemplate.setType(componentInstance.getToscaComponentName()); + Either originComponentRes = capabiltyRequirementConvertor + .getOriginComponent(componentCache, componentInstance); + if (originComponentRes.isRight()) { + convertNodeTemplatesRes = Either.right(ToscaError.NODE_TYPE_REQUIREMENT_ERROR); + break; + } Either requirements = convertComponentInstanceRequirements(component, componentInstance, component.getComponentInstancesRelations(), nodeTemplate, - componentCache.get(componentInstance.getComponentUid())); + originComponentRes.left().value()); if (requirements.isRight()) { convertNodeTemplatesRes = Either.right(requirements.right().value()); break; @@ -596,7 +629,7 @@ public class ToscaExportHandler { nodeTemplate = requirements.left().value(); - Component componentOfInstance = componentCache.get(componentInstance.getComponentUid()); + Component componentOfInstance = componentCache.get(componentInstance.getActualComponentUid()); nodeTemplate.setMetadata(convertMetadata(componentOfInstance, true, componentInstance)); Either capabilities = capabiltyRequirementConvertor @@ -634,9 +667,17 @@ public class ToscaExportHandler { groupsMap = new HashMap<>(); } for (GroupInstance groupInst : groupInstances) { - ToscaGroupTemplate toscaGroup = convertGroupInstance(groupInst); + boolean addToTosca = true; + + List artifacts = groupInst.getArtifacts(); + if (artifacts == null || artifacts.isEmpty()) { + addToTosca = false; + } - groupsMap.put(groupInst.getName(), toscaGroup); + if (addToTosca) { + ToscaGroupTemplate toscaGroup = convertGroupInstance(groupInst); + groupsMap.put(groupInst.getName(), toscaGroup); + } } } @@ -729,6 +770,7 @@ public class ToscaExportHandler { } private ToscaGroupTemplate convertGroup(GroupDefinition group) { + ToscaGroupTemplate toscaGroup = new ToscaGroupTemplate(); Map members = group.getMembers(); if (members != null) @@ -845,7 +887,7 @@ public class ToscaExportHandler { return toscaNodeType; } - /*private Either, ToscaError> createProxyNodeTypes(Component container) { + private Either, ToscaError> createProxyNodeTypes(Component container) { Map nodeTypesMap = null; Either, ToscaError> res = Either.left(nodeTypesMap); @@ -855,13 +897,15 @@ public class ToscaExportHandler { if (componetInstances == null || componetInstances.isEmpty()) return res; Map serviceProxyInstanceList = new HashMap<>(); - List proxyInst = componetInstances.stream().filter(p -> p.getOriginType().name().equals(OriginTypeEnum.ServiceProxy.name())).collect(Collectors.toList()); - if(proxyInst != null && !proxyInst.isEmpty()){ - for(ComponentInstance inst: proxyInst){ + List proxyInst = componetInstances.stream() + .filter(p -> p.getOriginType().name().equals(OriginTypeEnum.ServiceProxy.name())) + .collect(Collectors.toList()); + if (proxyInst != null && !proxyInst.isEmpty()) { + for (ComponentInstance inst : proxyInst) { serviceProxyInstanceList.put(inst.getToscaComponentName(), inst); } } - + if (serviceProxyInstanceList.isEmpty()) return res; ComponentParametersView filter = new ComponentParametersView(true); @@ -894,7 +938,7 @@ public class ToscaExportHandler { } return Either.left(nodeTypesMap); - }*/ + } private ToscaNodeType createProxyNodeType(Component origComponent, Component proxyComponent, ComponentInstance instance) { @@ -920,8 +964,9 @@ public class ToscaExportHandler { ToscaNodeTemplate nodeTypeTemplate, Component originComponent) { List> toscaRequirements = new ArrayList<>(); - if(!addRequirements(component, componentInstance, relations, originComponent, toscaRequirements)){ - log.debug("Failed to convert component instance requirements for the component instance {}. ", componentInstance.getName()); + if (!addRequirements(component, componentInstance, relations, originComponent, toscaRequirements)) { + log.debug("Failed to convert component instance requirements for the component instance {}. ", + componentInstance.getName()); return Either.right(ToscaError.NODE_TYPE_REQUIREMENT_ERROR); } if (!toscaRequirements.isEmpty()) { @@ -931,82 +976,114 @@ public class ToscaExportHandler { return Either.left(nodeTypeTemplate); } - private boolean addRequirements(Component component, ComponentInstance componentInstance, List relations, Component originComponent, + private boolean addRequirements(Component component, ComponentInstance componentInstance, + List relations, Component originComponent, List> toscaRequirements) { boolean result; - List filteredRelations = relations.stream().filter(p -> componentInstance.getUniqueId().equals(p.getFromNode())).collect(Collectors.toList()); - if(CollectionUtils.isEmpty(filteredRelations)){ + List filteredRelations = relations.stream() + .filter(p -> componentInstance.getUniqueId().equals(p.getFromNode())).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(filteredRelations)) { result = true; } else { - result = !filteredRelations.stream().filter(rel -> !addRequirement(component,componentInstance, originComponent, component.getComponentInstances(), rel, toscaRequirements)).findFirst().isPresent(); + result = !filteredRelations.stream().filter(rel -> !addRequirement(componentInstance, originComponent, + component.getComponentInstances(), rel, toscaRequirements)).findFirst().isPresent(); } return result; } - - private boolean addRequirement(Component component,ComponentInstance fromInstance, Component originComponent, List instancesList, RequirementCapabilityRelDef rel, List> toscaRequirements){ - + + private boolean addRequirement(ComponentInstance fromInstance, Component fromOriginComponent, + List instancesList, RequirementCapabilityRelDef rel, + List> toscaRequirements) { + boolean result = true; - Map originComponents = new HashMap<>(); - Map> reqMap = originComponent.getRequirements(); - RequirementAndRelationshipPair reqAndRelationshipPair = rel.getRelationships().get(0); + Map> reqMap = fromOriginComponent.getRequirements(); + RelationshipInfo reqAndRelationshipPair = rel.getRelationships().get(0).getRelation(); Either getOriginRes = null; Optional reqOpt = null; Component toOriginComponent = null; Optional cap = null; - Either buildCapNameRes = null; - Either buildReqNameRes = null; - - ComponentInstance toInstance = instancesList.stream().filter(i -> rel.getToNode().equals(i.getUniqueId())).findFirst().orElse(null); + + ComponentInstance toInstance = instancesList.stream().filter(i -> rel.getToNode().equals(i.getUniqueId())) + .findFirst().orElse(null); if (toInstance == null) { - log.debug("Failed to find a relation from the node {} to the node {}", fromInstance.getName(), rel.getToNode()); + log.debug("Failed to find a relation from the node {} to the node {}", fromInstance.getName(), + rel.getToNode()); result = false; } - if(result){ - - if(component.getComponentType().equals(ComponentTypeEnum.SERVICE)) { - reqOpt = findRequirement(reqMap, reqAndRelationshipPair); - } - else { - reqOpt = findRequirement(reqMap, reqAndRelationshipPair.getRequirementUid()); - } - if(!reqOpt.isPresent()){ - log.debug("Failed to find a requirement with uniqueId {} on a component with uniqueId {}", reqAndRelationshipPair.getRequirementUid(), originComponent.getUniqueId()); + if (result) { + reqOpt = findRequirement(fromOriginComponent, reqMap, reqAndRelationshipPair, toInstance.getUniqueId()); + if (!reqOpt.isPresent()) { + log.debug("Failed to find a requirement with uniqueId {} on a component with uniqueId {}", + reqAndRelationshipPair.getRequirementUid(), fromOriginComponent.getUniqueId()); result = false; } } - if(result){ + if (result) { ComponentParametersView filter = new ComponentParametersView(true); filter.setIgnoreComponentInstances(false); filter.setIgnoreCapabilities(false); - getOriginRes = toscaOperationFacade.getToscaElement(toInstance.getComponentUid(), filter); - if(getOriginRes.isRight()){ - log.debug("Failed to build substituted name for the requirement {}. Failed to get an origin component with uniqueId {}", reqOpt.get().getName(), toInstance.getComponentUid()); + getOriginRes = toscaOperationFacade.getToscaElement(toInstance.getActualComponentUid(), filter); + if (getOriginRes.isRight()) { + log.debug("Failed to build substituted name for the requirement {}. Failed to get an origin component with uniqueId {}", + reqOpt.get().getName(), toInstance.getActualComponentUid()); result = false; } } - if(result){ + if (result) { toOriginComponent = getOriginRes.left().value(); - cap = toOriginComponent.getCapabilities().get(reqOpt.get().getCapability()).stream().filter(c -> c.getName().equals(reqAndRelationshipPair.getCapability())).findFirst(); - if(!cap.isPresent()){ - log.debug("Failed to find a capability with name {} on a component with uniqueId {}", reqAndRelationshipPair.getCapability(), originComponent.getUniqueId()); + cap = toOriginComponent.getCapabilities().get(reqOpt.get().getCapability()).stream() + .filter(c -> c.getName().equals(reqAndRelationshipPair.getCapability())).findFirst(); + if (!cap.isPresent()) { + cap = findCapability(reqMap, reqAndRelationshipPair, toOriginComponent, fromOriginComponent, reqOpt.get(), fromInstance); + if(!cap.isPresent()){ result = false; + log.debug("Failed to find a capability with name {} on a component with uniqueId {}", + reqAndRelationshipPair.getCapability(), fromOriginComponent.getUniqueId()); + } } } - if(result){ - buildCapNameRes = capabiltyRequirementConvertor.buildSubstitutedName(originComponents, toOriginComponent, cap.get().getPath(), reqAndRelationshipPair.getCapability()); - if(buildCapNameRes.isRight()){ - log.debug("Failed to build a substituted capability name for the capability with name {} on a component with uniqueId {}", reqAndRelationshipPair.getCapability(), originComponent.getUniqueId()); - result = false; - } + if (result) { + result = buildAndAddRequirement(toscaRequirements, fromOriginComponent, toOriginComponent, cap.get(), + reqOpt.get(), reqAndRelationshipPair, toInstance); } - if(result){ - buildReqNameRes = capabiltyRequirementConvertor.buildSubstitutedName(originComponents, originComponent, reqOpt.get().getPath(), reqAndRelationshipPair.getRequirement()); - if(buildReqNameRes.isRight()){ - log.debug("Failed to build a substituted requirement name for the requirement with name {} on a component with uniqueId {}", reqAndRelationshipPair.getRequirement(), originComponent.getUniqueId()); + return result; + } + + private Optional findCapability(Map> reqMap, RelationshipInfo reqAndRelationshipPair, Component toOriginComponent, Component fromOriginComponent, RequirementDefinition requirement, ComponentInstance fromInstance) { + Optional cap = Optional.empty(); + Optional findAny = reqMap.values().stream().flatMap(e -> e.stream()).filter(e -> e.getName().equals(reqAndRelationshipPair.getRequirement())).findAny(); + if (findAny.isPresent()) { + RequirementDefinition reqDefinition = findAny.get(); + cap = toOriginComponent.getCapabilities().get(requirement.getCapability()).stream().filter(c -> c.getType().equals(reqDefinition.getCapability())).findFirst(); + if (!cap.isPresent()) { + log.debug("Failed to find a capability with name {} on a component with uniqueId {}", reqAndRelationshipPair.getCapability(), fromOriginComponent.getUniqueId()); + } + } + return cap; + } + + private boolean buildAndAddRequirement(List> toscaRequirements, Component fromOriginComponent, Component toOriginComponent, CapabilityDefinition capability, RequirementDefinition requirement, RelationshipInfo reqAndRelationshipPair, ComponentInstance toInstance) { + boolean result = true; + Either buildReqNameRes = null; + Either buildCapNameRes = capabiltyRequirementConvertor.buildSubstitutedName(originComponents, + toOriginComponent, capability.getPath(), reqAndRelationshipPair.getCapability()); + if (buildCapNameRes.isRight()) { + log.debug( + "Failed to build a substituted capability name for the capability with name {} on a component with uniqueId {}", + reqAndRelationshipPair.getCapability(), fromOriginComponent.getUniqueId()); + result = false; + } + if (result) { + buildReqNameRes = capabiltyRequirementConvertor.buildSubstitutedName(originComponents, fromOriginComponent, + requirement.getPath(), reqAndRelationshipPair.getRequirement()); + if (buildReqNameRes.isRight()) { + log.debug( + "Failed to build a substituted requirement name for the requirement with name {} on a component with uniqueId {}", + reqAndRelationshipPair.getRequirement(), fromOriginComponent.getUniqueId()); result = false; } } - if(result){ + if (result) { ToscaTemplateRequirement toscaRequirement = new ToscaTemplateRequirement(); Map toscaReqMap = new HashMap<>(); toscaRequirement.setNode(toInstance.getName()); @@ -1017,39 +1094,49 @@ public class ToscaExportHandler { return result; } - private Optional findRequirement(Map> reqMap, String reqId) { + private Optional findRequirement(Component fromOriginComponent, Map> reqMap, RelationshipInfo reqAndRelationshipPair, String toInstanceId) { for(List reqList: reqMap.values()){ - Optional reqOpt = reqList.stream().filter(r -> r.getUniqueId().equals(reqId)).findFirst(); + Optional reqOpt = reqList.stream().filter(r -> isRequirementBelongToRelation(fromOriginComponent, reqAndRelationshipPair, r, toInstanceId)).findFirst(); if(reqOpt.isPresent()){ return reqOpt; } } return Optional.empty(); } - - private Optional findRequirement(Map> reqMap, RequirementAndRelationshipPair reqAndRelationshipPair) { - for(List reqList: reqMap.values()){ - Optional reqOpt = reqList.stream().filter(r -> - isRequirmentBelongTo(reqAndRelationshipPair, r)) - .findFirst(); - if(reqOpt.isPresent()){ - return reqOpt; - } - } - return Optional.empty(); + + /** + * Allows detecting the requirement belonging to the received relationship + * The detection logic is: A requirement belongs to a relationship IF 1.The + * name of the requirement equals to the "requirement" field of the + * relation; AND 2. In case of a non-atomic resource, OwnerId of the + * requirement equals to requirementOwnerId of the relation OR uniqueId of + * toInstance equals to capabilityOwnerId of the relation + * + * @param fromOriginComponent + * @param reqAndRelationshipPair + * @param requirement + * @param toInstanceId + * @return + */ + private boolean isRequirementBelongToRelation(Component originComponent, RelationshipInfo reqAndRelationshipPair, RequirementDefinition requirement, String toInstanceId) { + if (!StringUtils.equals(requirement.getName(), reqAndRelationshipPair.getRequirement())) + return false; + if (!ModelConverter.isAtomicComponent(originComponent)) + return isRequirementBelongToOwner(reqAndRelationshipPair, requirement, toInstanceId); + return true; } - private boolean isRequirmentBelongTo(RequirementAndRelationshipPair reqAndRelationshipPair, RequirementDefinition r) { - return StringUtils.isNotEmpty(r.getOwnerId()) && r.getOwnerId().equals(reqAndRelationshipPair.getRequirementOwnerId()) - && StringUtils.isNotEmpty(r.getName()) && r.getName().equals(reqAndRelationshipPair.getRequirement()); + private boolean isRequirementBelongToOwner(RelationshipInfo reqAndRelationshipPair, RequirementDefinition requirement, String toInstanceId) { + return StringUtils.equals(requirement.getOwnerId(), reqAndRelationshipPair.getRequirementOwnerId()) || StringUtils.equals(toInstanceId, reqAndRelationshipPair.getCapabilityOwnerId()); } - private Either convertCapabilities(Component component, SubstitutionMapping substitutionMappings) { - - Either result = Either.left(substitutionMappings);; + private Either convertCapabilities(Component component, + SubstitutionMapping substitutionMappings) { + + Either result = Either.left(substitutionMappings); Either, ToscaError> toscaCapabilitiesRes = capabiltyRequirementConvertor .convertSubstitutionMappingCapabilities(originComponents, component); - if(toscaCapabilitiesRes.isRight()){ + if (toscaCapabilitiesRes.isRight()) { result = Either.right(toscaCapabilitiesRes.right().value()); log.error("Failed convert capabilities for the component {}. ", component.getName()); } else if (MapUtils.isNotEmpty(toscaCapabilitiesRes.left().value())) { @@ -1108,6 +1195,7 @@ public class ToscaExportHandler { } private class RepresentNull implements Represent { + @Override public Node representData(Object data) { // possible values are here http://yaml.org/type/null.html return representScalar(Tag.NULL, ""); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaMetadata.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaMetadata.java index 604a52083b..4f91e211cc 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaMetadata.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaMetadata.java @@ -38,7 +38,12 @@ public class ToscaMetadata implements IToscaMetadata { private Boolean serviceEcompNaming; private Boolean ecompGeneratedNaming; private String namingPolicy; - + private String sourceModelInvariant; + private String environmentContext; + private String sourceModelName; + private String sourceModelUuid; + + public String getName() { return name; } @@ -179,4 +184,37 @@ public class ToscaMetadata implements IToscaMetadata { this.customizationUUID = customizationUUID; } + public String getSourceModelInvariant() { + return sourceModelInvariant; + } + + public void setSourceModelInvariant(String sourceModelInvariant) { + this.sourceModelInvariant = sourceModelInvariant; + } + + public String getSourceModelName() { + return sourceModelName; + } + + public void setSourceModelName(String sourceModelName) { + this.sourceModelName = sourceModelName; + } + + public String getSourceModelUuid() { + return sourceModelUuid; + } + + public void setSourceModelUuid(String sourceModelUuid) { + this.sourceModelUuid = sourceModelUuid; + } + + + + public String getEnvironmentContext() { + return environmentContext; + } + + public void setEnvironmentContext(String environmentContext) { + this.environmentContext = environmentContext; + } } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserBusinessLogic.java index 7135bfb62e..90318a6259 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserBusinessLogic.java @@ -34,7 +34,6 @@ import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.dao.utils.UserStatusEnum; -import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.User; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/RollbackManager.java b/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/RollbackManager.java index 7485a8dc43..7098021d1f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/RollbackManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/RollbackManager.java @@ -20,16 +20,16 @@ package org.openecomp.sdc.common.transaction.mngr; -import fj.P; -import fj.data.Either; -import fj.data.HashMap; -import fj.data.List; - import org.openecomp.sdc.common.transaction.api.RollbackHandler; import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum; import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBTypeEnum; import org.openecomp.sdc.common.util.MethodActivationStatusEnum; +import fj.P; +import fj.data.Either; +import fj.data.HashMap; +import fj.data.List; + public class RollbackManager { private final HashMap rollbackHandlersMap; private final Integer transactionId; diff --git a/catalog-be/src/main/resources/application-context.xml b/catalog-be/src/main/resources/application-context.xml index 6c44b270c2..2b3603ce3b 100644 --- a/catalog-be/src/main/resources/application-context.xml +++ b/catalog-be/src/main/resources/application-context.xml @@ -22,6 +22,7 @@ org.openecomp.sdc.be.impl, org.openecomp.sdc.be.auditing.impl, org.openecomp.sdc.be.components.impl, + org.openecomp.sdc.be.components.merge, org.openecomp.sdc.be.components.distribution.engine, org.openecomp.sdc.be.distribution, org.openecomp.sdc.be.components.clean, diff --git a/catalog-be/src/main/resources/config/configuration.yaml b/catalog-be/src/main/resources/config/configuration.yaml index 2ae2cccb77..190153cb0a 100644 --- a/catalog-be/src/main/resources/config/configuration.yaml +++ b/catalog-be/src/main/resources/config/configuration.yaml @@ -21,9 +21,9 @@ beProtocol: http # catalog backend ssl port beSslPort: 8443 -version: 1.0 +version: 1.1.0 released: 2012-11-30 -toscaConformanceLevel: 4.0 +toscaConformanceLevel: 5.0 minToscaConformanceLevel: 3.0 titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties @@ -575,6 +575,12 @@ onboarding: downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" healthCheckUri: "/onboarding-api/v1.0/healthcheck" +dcae: + protocol: http + host: 127.0.0.1 + port: 8080 + healthCheckUri: "/dcae/healthCheck" + switchoverDetector: gBeFqdn: AIO-BE.ecomp.idns.cip.com gFeFqdn: AIO-FE.ecomp.idns.cip.com @@ -637,3 +643,22 @@ genericAssetNodeTypes: VF : org.openecomp.resource.abstract.nodes.VF PNF: org.openecomp.resource.abstract.nodes.PNF Service: org.openecomp.resource.abstract.nodes.service + +workloadContext: Production +environmentContext: + defaultValue: General_Revenue-Bearing + validValues: + - Critical_Revenue-Bearing + - Vital_Revenue-Bearing + - Essential_Revenue-Bearing + - Important_Revenue-Bearing + - Needed_Revenue-Bearing + - Useful_Revenue-Bearing + - General_Revenue-Bearing + - Critical_Non-Revenue + - Vital_Non-Revenue + - Essential_Non-Revenue + - Important_Non-Revenue + - Needed_Non-Revenue + - Useful_Non-Revenue + - General_Non-Revenue diff --git a/catalog-be/src/main/resources/config/error-configuration.yaml b/catalog-be/src/main/resources/config/error-configuration.yaml index fbf397a999..9dc0355212 100644 --- a/catalog-be/src/main/resources/config/error-configuration.yaml +++ b/catalog-be/src/main/resources/config/error-configuration.yaml @@ -1851,4 +1851,30 @@ errors: code: 400, message: 'Error: VSP %1 cannot be imported. The VSP contains internal loop in VFC %2', messageId: "SVC4671" + } +#---------SVC4672------------------------------ +# %1 - capability uniqueId +# %2 - instance uniqueId +# %3 - container uniqueId + CAPABILITY_OF_INSTANCE_NOT_FOUND_ON_CONTAINER: { + code: 404, + message: "Error: Requested capability %1 of instance %2 was not found on the container %3.", + messageId: "SVC4672" + } +#---------SVC4673------------------------------ +# %1 - requirement uniqueId +# %2 - instance uniqueId +# %3 - container uniqueId + REQUIREMENT_OF_INSTANCE_NOT_FOUND_ON_CONTAINER: { + code: 404, + message: "Error: Requested requirement %1 of instance %2 was not found on the container %3.", + messageId: "SVC4673" + } +#---------SVC4674----------------------------- +# %1 - relation Id +# %2 - container uniqueId + RELATION_NOT_FOUND: { + code: 404, + message: "Error: Requested relation %1 was not found on the container %2.", + messageId: "SVC4674" } \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.yml b/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.yml index 45c2b812cf..4e25d735d0 100644 --- a/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.yml +++ b/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.yml @@ -27,6 +27,11 @@ tosca.capabilities.Container: required: false constraints: - greater_or_equal: 0 MB +org.openecomp.capabilities.PortMirroring: + derived_from: tosca.capabilities.Root + properties: + connection_point: + type: org.openecomp.datatypes.PortMirroringConnectionPointDescription tosca.capabilities.Endpoint: derived_from: tosca.capabilities.Root properties: diff --git a/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.zip b/catalog-be/src/main/resources/import/tosca/capability-types/capabilityTypes.zip index 268287a39d49e8025aad7611b608b32ddbc76953..84871d6a0701df9130d763591f6de88c3063f71d 100644 GIT binary patch delta 1641 zcmV-v2A28042%sMP)h>@6aWAK2mm^ThD%Y>Yxdv;006HX000w{?gbWq%~?xt<2De! z=T{KeOAB~~=ITQM$Ifm8Bx@s1_Od7hS{mDIC{iUUZ?eC>LyD5Ex7@hJ`e4}9JU-5w zl#x23K}1u!VVoHTI(U@QOvx1?G3ZFK)G#Tgf z2jz)2R70IeqeR6HK(Y4y8zuRAd*R14TF_b=7A|C6%)Jn1P&rX`8Mmq zR3ff&cg6myAYy8$U9TaSmr_<%$l{pGZ4rMf;#}7|aN~a?BgtzKXe=7P6vLKg9Cu`* zH0MFcReHOL1#EkNe5N7F6jZr3QgWc8uI9*;DITWO?CYU&impwW1sDpNG-7OsQGod_ z)l1Ghnzc|;?qKzJ_jUGk>y{Y?G^0kUF&5S`Q_(<>A1G&Wh~F9dkbLtz6Jn^^ftipL zu%7=}+Cf+KCN%BYf2Y!fiI9WXSzlcHb*%X6E!5E-5_+V6JqE-&g$S3a!L4pGQ$!p~ zLmI~lv~IOXOXw~zS!`=ME8Yv@zQhSu*@m;|JbBF=`atG;Dt17yl@`9Ngc8alna-bY znbL-&PH{m*wlWiOGXlx#`R4v^?jCHpq{bI1`>FK#-;dRXiI_!L1vP4;#;Nqmyw!=` z%Z$flRRL z3$JKOW~T?r-J@9OO8PbC8R>pgP72E^*fEV|KL@q=vL2uGcBv0gU+m0cOp0?urwo;1 z%@@YPZBp4C8I|Sp7GXx05oP`2Em)60UtJwzFX$qFmCnLV+C(l9fQym!8yY_uC9tCh zQ5Ef(!M@k%5W`j1(T(QGBaG?1BH55SkM#gbH@N&_2V097)^^m{@NrJ)u$e8$3`;c? z5!4E4byzL4FE85(ef?K_{_hZP%La-Haf2Z~de`~xGWUS3NpKS5c=bJBdf#A20`8ZIsMAbFP5L!(n*Z?^RW z(mfL|qXWsMPtO5hhAq%wM|*^Pjv6nt4dM0>JOFO%%#or8-x=bL+OKMDb4CQ_lk-R3 z&6$XJ7P}b%NX|n_S#R|jf*E`$?7)ynoMt6|x+!Q$C3|%1sizf0&q!+S-s;;Jror1FzvRTV>T&bO-{=s(rz#oE7R(-WNk6hRBaD@{_4 z|L0kfaqO-K{Jj8f=!ATx8IBE9!~{$fG>{J3$@+6ARsE`=6YSj6R{=Mn+K|QJe&Viw z6DGwxI6=u$(LTgOwymEVoT&d`;ra!$^4TAg`O!{H@Wwvsvbk`{G zl_`@^zRoLQj&87v_stew;5;w6qlSWx*J{(_ZS&yByIom`jnZti%z2u%3+#7)(^&_e z5pF+!?(LBGNviKup$PxN=pCZq)dZidf0z0)!tN4Gl}`+Jc@c5<63^NvZ>TOJ)aT#H zVRUwSgE3x5B`@>)jE)yjgEtdfP7n6A$1B#yP~$PJE@9~6w|X`!GrOU_>-9|!z<&Tx zO928D02BZK00;m&g@#K}(rfk+-~|8xuN(jX696Ot000000h8zjC@u@n<^Gfv(*Y|$ nhr^Q<(*ZCdYk}ql(*aOR1qJ{B000310RUwH000pN000004el3G delta 1591 zcmV-72FUr04ZaM2P)h>@6aWAK2mnQ}GfNdM^JkI;008P6000vJ003iQaA9I;Y-x0P zRC#b^b1r#pY|UBSZ__Xkf9J2T#0y9xVy}HbDlH$AfK_Y93qq0WTw6284z|;+{Pmpe zq*=bY1O{3ks>Zqd-TA)lT4flG7|rOK3vM}>=t?O&AT)@o z5{>W4tmHV5)gc2yg&@lAKo>-7YM@DE5K;3zkd0R9vku8qYbo2MAngRj2jV1l)DzO9 zXcx>EmB3#C%#^g0OVGnn2+6d{K)V&>!jH_;m}R+frt}|+CYTT|Eo?y-YZ`v$TthM; z8!8MGt4v9MV>LxmhgE!Dk*x-5LB~qR$VSD4ocp&Z1+~K^knAw2Nke4?)vt2NZFD4g z9NDj3nli7cds8wGWq=06Qq#-XQ>_TeEZ0zf=UOWzfXb$riYeD3&Zyl@NRM`H zVMhgHNmCfhD8b$;eG_;Gvy$cx7FQQvr>l2<)~v9%{)n%5e1NxWw`GNRiy=OE*KUwLIUh%J#cl?U$w#KT9s4~h zFhY9V*=~Kc00_0#>|!jfBZr-qtQuZ_Xyt7!+xk?^w;$G3Ic4CnQTIyZDGUV+*)}|F z%0T+W<;~zg^68`WHbS>cU@FZT2S03q7CYJ%_&I6>XqSeYee@Zu9y?O>>o*3jlHNQ) zPl?2Q^8N_joJ%HhB=Idg@Q@?cp*cfvi!Y@c7*d7PtU@59vSk=>^|+ZTgICu<^sFx9)Hh4Sb9c2(0mI>ln}5i8gD1(&#lsjp~}t*`ntkxRb9y9aDV1c z;%CJ?h(8R*3B9NBXxlc<4c=6LgH3&vOUu)H0qfa&#huE)u<>XHTqykA)pH)q-+!Nw zc)oD+Iy-9Fk)dv49&EvCzlG~PM>%wtf+O-`wJTOx#lcO`=jFIKeb@_2nPv+m1Y$pB zHyBitWI@j^M<|{Q^~2@*2TsQ1BB>|hzcB1d)9lGx)uNJ5!KBYGzf2c@UXJD`_VIIX z58ivFZ>dIz3He(nxUIP$s z;eqtA_ZSmDVA7if8e*;iU0Rle&6aWAK z2mnQ}GfNdM^JkI;008P6000vJBme*a00000AOHXW00000V_|TULIxZz{=~q_c`?%g p08@6aWAK2mk_iQA^$}AP=nr005s5000pH003iQbY*96a(PsF zaAk8Yd2MX9mrZZfFc60CNc;zj%N~FO&{J=v1%$LkRm+z^mF4xii>YHrj?;Ge^-Sz> zoNQ)OKqaT$yl&vZ7Ll>`A`=B;VK4+2)Xa zUsR|pE|c^@gYm(r}O`xP!g0gQs(>gG~DD-k z9Ehb~4P+{_6MomuhZ1RdZ=~e|MS5?qyl8@NWoW&kB8?q%q*m4nm^&qqOLkhYvjqU- zsw!uBF8%XTW7F)Cmt}VL&d*3n^{B3mhWOf9D&2v9e1FQXonI@@-xyUX8>mE+gQ0^? zZxubs(!ZloqWl8-)$Zb$=9^q}5K(-|HYjklnh5~vzk8EO~Mar38 zC(*#r@Yi`SomlhN!U!wrIq3{68)&=%OLi3Ui3nmP8gj*DjpnUUEv&cNL!&a}%w~;d zU7?zPSnrfoUd!<^z?*dWKWrB%U8)MfaewGXW@OKq=zNhIp5Gwi|LV6j8=E4^ubT=(PAj-=UP z4lqc;Yo0dEs;*>8>qH8543+9^-bYHU93Q=5y*8WIMcf3b8H&oja)a1B?Vp3z4gEG2 zG)3#h8KBIb!u%BQkUb@$G{bAb5w?RZKuhoN7*7$4K0EGeU>o!wE6g@%Nmg4g&R|7< z_B=>G=!ny%aOPnDB4;xxGqAcd3@1~_AKI#=65eXNp_pi4*)un%V_FLHQB}2pk{uU! zzB^mir_O39BtT_5m0)r8vFIGD-pB(Q@nmR>3qh^%G`W*%R`X$VE@zq*uRkE}9#qiA zz1m%+A6w|9<}0>TDn@d!Y@s8BXySK&9JjH>W!d8E)AsH}RqY)`hc8EvS=4E?t~qFY z-8lx>i?rg7)|Ivt7NjV}C|PHnVb2iI!heBf7~?lkO928u02BZK00;mAcTr2;Eg%oA0{{S@5C8y^+5;~x xu+g~ZK1b65@D*OjK1b65_BR`LDkswcP)h{{000000RRC2V*mgE+yejr003RH{{;X5 delta 1047 zcmV+y1nB$K2)77-P)h>@6aWAK2ml&`F-xkxT+WXJ008h0000pH003iQbY*96a(PsF zaAk8Yd2MX9mrYOHFc60C{S{U(dni5dapJ~T5z>MXP+GM@me*^Li(^NQ18jeNC-ykm zY$m(V(wuhlzJ5IZn6XnS|D>g=_CGLq&fQEK9TxB}K2{WeYM*_~uRr2zEuF3Q+0RLV z!sIS07b-kE|H!A?e0K$b5}R&+-W^~pwlf^mRo31ZY46h-&>muL-Pt8S62|Z&XM=ZU zh1Te-(HZIkrfeF^BpRfi?40oHG;=FFP#7w28YWFc_0>eLDpz}4PHa3C3*~p>dJN}q zC$C0T&!h-{>cM#ptr>Q77Jt;tg|H3N;$De#}gf}o*7;vSOL zQobErG)rlf49-^s3=FI@bj;zjL5wmR;dkkLXuFwi>Sp>b-JIEbFRI{c8EUVHZu$nY zn_89%fc*u>tQqFan&pP^6os=q@5!rnHx1)TR+hnk*}8TjVvq-AX*Be$oh1TYQa1&A z==@xHeqvOiY#>5R28ISQuvxSuM_!a(h%qm_3>b+tnaCbQXG^YbBdggs9mKz*_DbE5 zJFIlCsCIBJsJRv?S~3};&QO12#8W5c{7@KSB{>z1&azIj4LH!yVUI-+Gf`1Fl_e53 zN3jKeebF8YkfCNXOC;zX#Rxi8R(UOZdmZ1Ad;A^CLtA^g{XK&gLQ*-CC6eT3zW{U% zDDj{sTMW=eSqGe|?l8+aN$nK0p3;s! zmO>rD`a6r&w_AmygA>+DYle3nj|?J+D2%Kkbj#CO)73mERdJ6Hs8$=N$!uwXUqiYD z4{@lB!)h>uMOQer^bYUX1g?|U4YycwbxCZ6Sp+SqMQpWkrpT6m&#MMENUlo<<(`^< z!6b~6%BV-qjVek5yQa6h^2;^*>fBi!;EjDiGc~5pl>4EFSF}DJ(3kEp#<&pF9B)4T zAhVe7MdQ(up!jUYtsb%H;$E#J$W0AJ!hFYCL3EG|EIUYih#vmJu_RCK+Ec1LuV0Q; zQNIvq_`Cv@MVaL4l7qzOjiF`cFP?*6d7&*qMVUpN#A3d1(KvvM;B@&B+Qg3&f}HjE z?K5(sqJ?|6eEMDEaqz=g3Y=xu=yb^F;J?AKdZ_k35MT3=NZ-K!08mQ-0zUv000008 z02+faORBzH&W{5C0Pqi!_5(34Y0HgQxG&QI!F+9pw=dHHv*>1eLgUf_P)h{{00000 R0RRC2V*mgEz5@UN002`a=>Y%$ diff --git a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml index 43debe6291..449842c2f4 100644 --- a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml +++ b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml @@ -55,6 +55,18 @@ tosca.datatypes.Credential: type: string required: false +org.openecomp.datatypes.PortMirroringConnectionPointDescription: + derived_from: tosca.datatypes.Root + properties: + nf_type: + type: string + nfc_type: + type: string + network_role: + type: string + pps_capacity: + type: string + tosca.datatypes.TimeInterval: derived_from: tosca.datatypes.Root properties: @@ -348,6 +360,11 @@ org.openecomp.datatypes.heat.neutron.port.FixedIps: description: IP address desired in the subnet for this port required: false status: SUPPORTED + subnet_id: + type: string + description: Subnet in which to allocate the IP address for this port + required: false + status: SUPPORTED org.openecomp.datatypes.heat.FileInfo: derived_from: tosca.datatypes.Root diff --git a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip index 506a58f4b1d8c689398c5c4cfa00bdef7fb120b7..1f79bf2c2d904c602c5c3c2873cff87ebacdeff6 100644 GIT binary patch literal 6601 zcmV;)88+rnO9KQH000080K0^SOIo3CPAM4x09L6001W^D0AyiwVN`i=WpgfhZEW2= zU31*FuJ8U8oMh&Znu=& zzPq_NCj~qvm+&^Zh1W@#BqXc0w2+VQ!jd+ROMp_aJtgZR+nt=Sw4xhY2 zsVq30oRn3;(v9oecUhLuFm-)>on&F<`f|cb=XZBu?)vI)W#)`8v?XEjv`(2bCPtS< z$$qE(e#RT^*DJR3d3{~bf7djP9!B~Qa?(ZhqM$KND;6fNh#OsmV!;;clPk zL;0%p5Cr1@Due(Riie<#wsaS&o)*A$DKyCXun+qrD>e&YS4yL7mm9oXWkq$xiXy|# z7g-7~psuen(9%mo_a{sWMAM9vUxHOC_7mlgk5g7*Q3YIQ+VX%+@Nn0k_^PPIywfzE(6dK~WYgkW{C}CQv*|M@ zS)PVHv@8?D;^B9~I4)>e(vBveIdvEML0VCQIiXV~j!3Bi7$b!8R}N9>!iilN1(F+o zCc7@_x-S-TS%&r~O94s<4GPPr@H8mGbOQr?B+pOD*$+Q_{{#8;@Gv(yjgFcXFMFVR}XNc0;-Xc9grkNbZqy*K^8cj;Xg7BO0Bw6mKc#6`u@PyP+B zS6doZnzD1DDXWmVdXpW8_UioNyX8u09IWiDC{OyP&{W%DQS3riV0)5kF85&Fs~SY_ z=I7Pw-TT|um%N?jzT-7icn;^r>9W3qe=dH?%IbYqR~E0(h27X4LI>y%vb4^~Ix7f7 z4Mae#ET zI!}@;3WWm)c5~7sA^O~vAz>P$W6~^0nwn6L1M6azSZ0nxaOK#I7*1;8@F2cy1LR#% zc-_!B69R5CmeRT^vUG97RbbkTol6A*)N&vIyn_{(IOVFIcO#HA6nS;mT{Vaoj?M?Rx;EiXy7<{TE?$^AAX*?n5_ zHpv-JZeuF|yGv*gZ=;T`%A|l*^nh(ZD>@H^t;yw27c0U_2`c6)zy~%T#;oK|52D!k zAdO!#WbF56%G?LLET*o!T(0(KdWx~*1fE$J`;K2ETd^H^yFYu1u;{u@2A(9%GK7!H zBn+d5)FSk!^8GpamM=U7Igj@!fhFC6pg;L*(9Hn`CHTXG*?_h+`V5$XJ5oSM0yJ}V zWNDPtF|M3kO?a+FM+74>_#chc|BZ0PA+*4T#xw?K8XI1TH;q{3=*2~I)K23dB?F{L z44sT~dpYGGgr&{p>e|2?aR*=?VMxRBNsB#UUEu?yB@b6iT7WVP2a4Tg0tAq)8Q8TF z#s*9-uWtly5)jInTpZj4>!arDuSW|OZ{Sb1;3o#$TXQ50dAtDyybm9yd&1**ItfkJ zRpv0jp-2Aq{MaVwo`WVmEiXri^s;^5y!^)ebtZoCY>BrDn8H6{dceI|v(E{2=i-X@ zAkbw~ZACC3G|#Xy=xH6PkOM5;6d)P22(lsoV3=Hd#-BwjK9s%fG4En|`F;XcQhWmD z6}xx}oww(k?ZX>xZdw@%zT~Z1?xnvcd=0RrEmM9Zp`UYHYZ}j$O97_yPWt{V&+?Tt zstZ;<1kww1b|&8>;Ra2p==YuU6FE?#fRaqC-x2{IzGCZfsR%@FgFA8P@@~PEorpyk z?^qgepC_o@oo$pZ-j$)MREP+NA?$(+I__Tezq1ltlZ1)gs0KY3E2S3de`YsCz(9tD zRTW0tqge-b=N^PwIs825#Tq)3qA?{HDny`j$w#SIu4C|qhq~qQ1 zSc-|jSNoL7eIJkc!A|@|>8adhHR!ffDH%&or`2m&1Wnvm+I{Dt0E`q>MnjqvyHG4A zf2#<<+rUd1aNCcvY+{{s?Yy+@P4IBfV0n+S0)FNh7cgOV89K67EAO7OSZP4`=PFWT z`5%$@K~xrR*k>9q^NEX|@LaxYa>f>lOPyYFAy_1%P|ohROqe|BE>SLdhUF1K+jMhy zOr{&#aU7)((uF$~B>~1mKK>wf9TuoJETL}tWzEb32!bGpRJX1Gt>Kv~KW?RQ;&b!! z`=yHSzAb1XR(;Gn-j!Jb;n5SxG&3&=3^dq>L-$xUy8dG?@8yNBEHX%$Hmv6&f`wAX zPnzzHUwdHC&U~y=qlYB{5Ww*hZAgncq1?w_HNJ+Eh;$7N-#p}*o7mW4;dWMSo%JP$ za|-M&zBaI)sK&Nd@idX4CxaQF14~)#JuGenOdNE|w7jpCUQL-1>6{{@A>J1eXF=KJ zftjM~FkVbE?=^u7>d8R*&Bb*bkzff-mj`&v?n?HVOjlf1f%ZDwd3tH+i|#%di7&w1 z4`Q?Dy0!Td=6M36fG@|IVgna8--s@JB}5pLDMfaBitlB|G<{WU?#eK#=LB(*D*D%v zBoP`R?jBNfsX9#{Z>lYRD{FkG*<+kB^dAhnJhUi^SAwEWdYUyn?-vqpo!ruvAOGCB zqn^w@`N+aayl+d*^cfiNQQDf)pAEU!9i-;?4JQsssl>dqZ|yT1W07K~Qa~mWk=5mq z{sV_WRtJ2yg6^`42Ad+Qb0Z{jVT=d^ush-1F{vi9Hep$25d;4|7I8a|h;)KfynK{o zPjL+pUDZ#NN&r&3uma_X$=!p9FlWTkttQb>%BMy-qxfCN?cXfYmBJLzEjZC0EO@Ot z>H3T!T(4O)N~2CQEm!-OUxM-$T-k7@CL6Okyf87?g`d0hw)ciQ1b>5*4xQMp-ibIS zt#@~{&?z=vrD+!i109Q4EJ(9yHk)MV0?ZaGp0$4Qs!Z7;m6zo~&bPsQWWmthd7Ca#S(q9Si}YMe{H$&BbH*r`+j_t z4Zf*m;R#@AOg{_x^OB$?_7gilM&(1pj#5R*5CHH)H$fTF(tG|!Pw0F;d25Q@GgsG9`0_8J>Mzwqo_kz1o$Biblo(y zd&6_Ypo=j>{HNGfEd#Z^syy4kDCcuoWE5Hm)UYM|ryK)*sE7rCPnd=2)O;~YCQvcE zEFG5|JtR-$t;%^GBUH0m01N$-r*XpMxzmohO+FD=kmtAA>3}*O$6F91#%#gqL5Pz(;*cF}%LC;q_-Se1^iB*r%Gtk=cCf zTdWA)H83~Fm)>|``Bm2GSWMUqQ(ZR2HOJ1fF75fMXSu=hFEPvKJQ04Jqbp#zxU>iO z7IGi~dKN*+cDZiyVc!k!C=r^#!%5g4tQs2jl+Ll6%GplFb<8J{+?pmF$8ENc7wb7N z`tMVJHtM_hG3BpaC3eWKaOcC6vWKH9A|3GhTU5D?hBWT{n6y)SOf{S{W`F5&;X@vq zI}41ZtjmN+STr7moqy6>XffEGebX1R<9r;CO2=`Yy9?V_SO96`tz$`_E`>zpS%5!Y zu}EL9HEmwXs&mzqrSjA}QO$9ho`)9gcqLX~T%+YO@U^@~>*zsSCxLuM=C4i|-ctaK zL$cH7UIHQdsBM4l)v06Onkoev`w_H|d-_!Tk6e+b zDV+Qz-#lY|ocLP~?zz&qMqfB%={GF3L z0iJHN1kmE5y<=sGwR8<)q9*n}tCJWlvAnc`AJSjfRb5cR8OmLWgveX5%7r-$5(_Z? z@rgeC`05{g;s4Pt1A~)v&absZ#=IAl<3G#(v>lpc3%^+zXilD3*!8~}%}2=RM_4;5 zs}MO`LX8$yA1Y9-IqTk^BTM~EakWflt5&mxk}O+B8>|N(7`k1C)=?E~l1~P?t_-Qz zFK*^w2FB-VS!`CKBs_F0uwB#JaSdIACy|PSs;`%;^Q%+x;qCb~`m{n3^>UTqg{qhO zdIG^pT_d3!4HcF0!SH5Cmn)pnNMXzL0}kZhpf%&|ozvKOI8MZ5*j2>H-ivq(Ts~mg%-pZ&2kpUp_~*(92!!#;`N0aM9e3pVh6frqmiyQ#;R zK(%ERvbZ+*XSG$J4W_{|SE73cZV!fRb(KBUSmQ|=?j#v-`QRl_CN@bT_!InJh0NQ*d@aoI z>twFNq*cCyCP|go%8>>|cudQz*3_Bj+@Jvp5WZA4C70Nq&4_K^4*Fnwb_m;1lLWEc zo`D6rZp7j!djz7EOOQv1+L$-QEesw{1cj8>0Lnr6D7ZK)J>f9(?L!Hjwe$xg7uwpr zG&jfT(Fz8Gab7-ubV~G(7v_)e%^xp~A1};4FJ3(Q)y9!V&zAf%YHKDv#Ot50&XExj zII&>IAQUSraWqz)^TfNzBr6(2qJ!rj0vKT*tW@Gp;^J%{=HZvp<@pixEF#k$WD!jYGlYziLNdXFu!>iX!m;4`AOU~NU%F*P00=K89gu{5! zpgWp480So9$R;l*1`ju-ky(<Q(8bIZfD97&mrPyczv&tBR6EXVu%p#BJ9I(qJTtP! zi-}t;nAGGA$7DAZ>kjAA=bv4_%>o}G=utBBfX((Jx6o69m3^`H?KWy`uEJ=}%oWy1 ze3@m){02g2HNrtX6xrLl8$(kUfgNP}YyACFwqv%hp?h*#yPADa%cBnidv&@)f62fkH?SeYB?I_@wshl-Y|i9-!_V0cCHP}VTC_i3z%E#KkIEVHur z9}64$!ju6IGy!WjeYqyuskN}IB_Z>$w_VjZH+y+4P`k9TUx0UKR4a>NRuo0q0Zu`$wiGGUB;3g#8`@nssecE5`_Hy@YQPkSv_Q*ec`T-gE> z;5)+XBJ@S{(Uc*pHrk5S-7H^Y^>}6amoa^FGkJL0W{PLVBAN~po9fr0`q$}U2@%oA z*A$F26WfmI>;c?BtY?jA20|4&Pps0$y;DtZm-Z%JH!_G_|N1MOm=WSm9+T@g+2x=b zt&?z{fvLHG=DMP9_)llc*4HM8If5v!%dTPQ_^_<}6qM}u{=tVROv2)6ow90y&*kGC z-MPI!O6OY^(X>3C&NUdcx==Ti*Y)6sBSta$K+`xYygqE#M`stNHP}u>sR(pb9Eb>T z05j3F=fiWSWaw6fQ4%h7ChBOumJkNvRX^^SGs!vgy)lFvp39Dr5dUDU@%I7OQXbhi z5rQ@mVoOX1m3s)vau;s=K9y*hh-_Wmhalmd%~9)A@J|u84d>8X+pydoe5+$~!Oe(1 zmG$mB%rq2umL1nl3#xk~xe>i!ZrD0A^x-3f9`^ATJ9bIJUnr-R=Hv}g{WtMP2 ze(N~c1N0y=zz6;L5M(vSog4yCJLxv^FoQ!&SUJx%QWs$!-m!#L50fc;Y)Zsq@`>^T z1n32ZEX5UGQG-hze#W48tGFO%G@p#;9|}c6U@$h)MA-NEN3(%Bx24edh2W1tb>7a@ zybzlM0Zhaizs-!RK=X~|8HI@tXjK*A+F#L~o=7L@u^Ay0n`^!j$Oe7J($yhQkFB1m z2`$43tnakt>G`W3b_L5gU2pVvQBTRzi@aX3G_{63jw%VRS&$1D2euf1>&;lAK2E;n zQeQzn^3ah*rzCzrUp^xJLsbpCOq4((XB1Hvh91Squz={bqTKCr($a=%^plnNMFNec z_vp^N(KCpWEb5e-n_95uCMMN0XhX&XH=+lQ0?=x?#~tCp}9q$w&U3qLfyr zWS1x9Daqpc1(!i7iKiqlX&q<5Jq$p8B@#E#s(bKbD=_O`mejgbBs{FHr>7~_qW{uf zo@yJDey-Yk2UcZZxesmFhI=L+U4~G5BaPN_Wk;-ckkVsJL728D9zBP!eVax6T2r3k zuv?XV$PyJp{hp;hi#KoGvmNVN?eQ`Vas1S0tRWJA%F2pgoHR^h+}!W#Ga|O(opE?i zoo6><&y66y%k(#}Lc?ahNf3FC$vd`es6)pgEPt=);$Qe3!^>Iwp82|uQsQ>^C03-ka0000103ZMW000000AyiwVN`i=WpgfhZEOkv zAOHXW000317yt%Fd3{<|(*dyE0~u0Q(*ZA*?j9Kh(*aOR1qJ{B000310RUeB002}O H00000^=gmt literal 6242 zcmV-o7@g-(O9KQH0000801mG+OBriy!IK4gHIkkH{~ns79wd;rGd*t$DWzwqPI@c8fS>Sg_fCpkPO zm+&@u1+No7ibz^+X)Yh%`UR~Y7XT$^J4)7h8Xq08q@){~19W*m^zgwM>7(K3s3>!m zY)s$2P1A__iRtU>DD_Lzmm^jfzZ?6R>8rmNsWH89FY@yzRl`&TlSHH3M zddXs&*Vj4yqoPT0f4B`iJlZGqBBvouO6Esr#EdUOvOLXbUNTznHvC4J1}O)@fADp{ z%?(K2LJ}DuJ0oj9Dk$Cs_-|<9;mgArV!m?}IU)j_eqMTDCi{}ZTktUM@>=E< zJrazD4lO&3B(wx&yjfg}zsqEu8upAXI}(nhDlWYkGkTY!hd|AV=%x8w$|cWQ+*7(NapT)tcWTL&P1Dx$ren`e^Xy=qSxM3$TZT25Fo%nA%dm)SR7*p0e_pX#lks z!(E+Ue70Pv9!D|&RJ2X8(`|=Lu?ty&JvhP@Kwbr=ck|O~^~1|o-(B+iEVIS8TsfjM zlXOwt!oQ2})1rKtRwZ>4H#R3Zwg+2Ur(~Vxq=Yb9K<@~iw=P-2jm1{ z#@BdA28f1&AybLn;L8%tAQA_$0r93Je3yhX6JVyXgjQvqCW{;F0;bcLJ=)J@2LjSE zV1R<#2HlZ{W4i@L-T+U2NdkCsOEF{)IinE2vrWQ1^QzV~;3Yejmz5tuR|V#hfcAOD zk|urvagni{(YltGBweF~Wpi@3O-Xu}6#Sl)jHR@Ny8YXTdf_(M>#K4e+-rKY1YUXY zK-ijGet)qdtdO8W>;fEd>tVEdn)~)#zC0(N@_{EO=iv@5u%Iy*`r{9S zZw}BaARg{cfP1~sTc8ZWksPKZz%%cTED542#E}!b31=3@6f+zAOH=jFkW|d47I58g zjUKv2#Z`B%GJSAS67BMMh?6cWZC;F=b9*>N5Yp2kU8eSnEaTJ?P}ZJL!f_c_ID(|$ z(^bfOKxY`5D0YSkG(fgy;MWSk4U}A7-w4_ekgzi`IG8%OU$k6*n`~J827j`JIML(L znjvc_;|+AcJOAE25+0}1$Y}OMWfjn)eD~s5J?Wl_C#{xebNaqdo_*51I^|brHpVVo zb%D0=JE#Z3n>BkIQFAG-cnbneHsuywj6~k_G8k!1?2rQ@-Q*NBn0smN0WeH1e$Jl- zEX-|$cd@*D=|GhV*$bc=+q0k-sIDvl)dZH8k_ z9l4?vU^;Ja!dYke3K~>7EAKrS1sVsF&m(_>E>yJpOvZ^EC{aL3isLuG>CywHr6Q2H z4agM!0uiimrNR$mNCxqk$E(bPZLluUlwnsXfe;QK{emGm=27(@X#t^0#DaTMIduo> zAJZEmV4%SKvh;)PWYK}&xuc;D_#x+HJb;HG!~guKH*uvv1BHB92FQdlbhDjeZZnLB zjU*j!e#?>&*D!Yp3vivuY81gn{6!h5+@@6$sxBqx((b%k4U5ndccq^-rviW}C>uAD zG>`r0|2G4$cJR^$%+{lN7P0pIynNJ{JlwHz3;N69GE2FE3Af9_elKs6vsej0mL_#j zNILI>q%5AZw=`U4j)R_vTt2IF#$ArZJLdT~{x;g#-Ij5er@|%5EpNGM=E^3y!zr0= zypMQfhmcH8BI&Twp0kLW*>G?68$b{QK@didlGZG;a)yd2^3%(unnQh>(@2c0nA^K8 z(g>y?kA)taxj)ottx=A8PgDkDEVi3v2l z0SG|+k#<&j6;U3?uGDyLXd-P1$pt#hj?_yAa!Aw5Q~Q=v7a!njgISxQ#JlPzLp^0| zxCpJ$LbBZzsf$`(!Y_A?$N&%_4aq(axCqpZZXnkcyihZ5=rV;Z1fk^{Jj$HYq6km-CE%Avn&EE5HGQS+KBl^Gyy9XFq}CB zaod`2L)7oT4MX>IF(=VQKOjru(+{NG#)>XgBM0_eeenyBxw}6`jY0g-^veT-qI|`} zSIqT(A?a3;0LS1Uod;7siqJ{+ZL4wDK!1#)ddiSC)OxZfX|l0WLAh3mgEo$gaus?t zUMA~M)WyX3fx{rH-q=lX5vPzy+d#G^gK4RaU?8BD%?WP~i7SyA!FByKU=ZJjd~VEV zL^=s6UY=&zE};RCtJ{fk1RyH*%U}y+-rnP!U{)H<>i*!qej-Z->+33PU$Y=qHz*eQ z1JhQ+_IILDJqH5n)@v4w@+ea|d_nx#LvUWht#6!aPnydzMlbf?>UQ1rmoCGfpwgic zi>p}7W0ESqrMa55bEpHxP?OVV77OypsMM_Gqlz5cviZDuB`P1=ofq;LVsXmG7Ig3B zDHYM4e2R-bkKa`<7U;1c!^(<(-g4syD&?Z`J@H$Ph^HSq%#D(%jJzY(QAQjLzKf%N zxbKvw#8{x_x}nah4LLjL1w5dKWqNaQ0d5?7A3{o0LauLVY+c{L5-Z<;l7TiZuA$c< zj0((JF6QpwaD)N5Nr;rn3i)2#G%g?^SW>hd_Xwj2jtF=|nF{qLRWnYnq;UorL#y6@ zqrvD|=qm{Z8+7w|;|hR9A^KL>pOpnIu^nGssjCZ`;wU72icPSS1b5Y_s>X58sr%UH zqfB(H=ujPiYEUIsxw8vsFrGNmL_ZxR8h4`sw$@^IcR6=Z`V4Z&xc(vr1SM|;Ro7D5 zI5Q)IiTwonMVjAR5qu?Ejb}?tsWF>~y*^op>CgULj;?W=#EsZ1IAN9{q3T&NT^9t~ zkV1m)^$7K@B{@~bb{@9#WIK%aeou3&KB-pcR+^SJDdY-4j%uJIYjcuWGCRpEaUyvZ z^O)Z(T&=;X0>F?vW&CcMdFMI-3V4&nGV^1;QaT}-rMN>_1mqz$O$n$YI%3eI){wXq zE1-q^TSvBDM6DuLMHT|BjYeEb9B`p#ED?3d9=db$V4OH`F}p2IOO770Cjy|S8`Z2H zpof2FH99EIoOjG^az$X#o84lk0qHz-D#}m+`~$9w4(Nf4fAUzDrft5F6L zc97_d`FjiV$3AMV%oenpJeWJfuQK{(;Q~quo~lbE%4;pYc@vfZ_Lt)xd`)0T%$G$u zmzZriy0N_beh7Sq!Wye;8be|8rEl*)E4{Iz^1ZCn>2YB*s9JchS+or9 z>jTg-Q28Ng`J5-hrvkcbzo>E> zozj@g!)c{r5B8oxziRUQbcNgWn(@Mv2nVTEidsqPZ z`oy{fQogT2h@Dn9{3Iycmp>uM=o}~2)rWnen$zT-hgN3rw)EiGDI3Js@~EoGNIlz9 zIE5KsbulnY188hSb=SQBBI-H&b+5)!>zXPB8ru=@kU-lL@drAIx`9Ot;rQycb%nxU z{ZE^cy(cwExA)GLUvKD}YW|JQ@iqip`GKUsWpK5$LVnKd+7IZoWV;4)Aj>Wt6+cPE zCMG;jz~Dj(+^Zp| z@NoWt6Zw1h&O_FWpEd`gMdaNB9EN+xK6M1{>z{LyMIgRy8iiE!)R+|o$h|>>D1W_6 zt0)AgE6;!sd*0VoS>=>)+3~0$BJz+av=IHn`2rYU!TIaooPEW|_-`x^b~xv!M4}8{ z3gzOzJ?9m)+K-rWC*S0xP zjc)4~e*@#$~97C3lr>Pq$R_Cad;NHK8y#hWuD8$5tV zbrK1kA3jC^vd{z8>+7-@-A%d(_v?_2DfqF1BVqYLS!+pw?Cfz>l)?ov{5D2(FU1by>GxHB*>qT~k?4*^5ucq^W%@)?%{R@6c&Gsv zk+%UO<5(U4goiu~nq7A>@IzZjmBGh?!se(;KBbGzg1lZ{3L4~5)bJPNhlea{@bJHE zZ-MdgLPZS4*3WA_I0(OQB#5C^(H?c+UqmH@7lXbSuJitoQQSEaype}j7m6(U7NTJ| zn{5JN4pvdqUFU5DC3}@R=#o?=t;EzaVUvm6L2qg-b8L;w!c3*?>E!yL=ozU!okZ=a zqSnbJ!L)71zynFcp6rjn)G`Tjf~nOU9`G=@6OmlYQ}q;5b%0YlI?J~A1vHMl=4XSf z!%4Hi>Cp<10iI`19~~2Yanii_qIvPGadGmrd2#aSx5NEx$v?!kW->y&{^{x*1rb0H z3w|t!ASB_tVD*+xR%lVwjzrIsZ)ub!n|gM}0qU)2;{3WuXdsmbWaSX_glxk~74xkm zciF`GK?q^ry#gd4iXZ`1Og9UWUh4DvHfw?jgT!&Hbp) zk(@n;eBkr|2pmp(dC|<>Ah+g2oBNbZzA}E;tAQdOwfnm|Fg+j_QCfw2yQx~U618Q! zGk5(|eyWLQVdO3*+=l3bg*;w7QWE9|nR;dF?Xu)QmoLzuj%npG#v7iz@jwE8y}Bmf z3JfBTh6%3okI$FAQpWA32?=mlEi~vCIB)&<(RgQh4ataEvsyatnBi&ZL?8l18aVBX0Biv@PUS*<|hT}(MTb+ z>B!dJy@8sV80?_Xzr*YA(-_1sSxcWp+FBUA>($> zm&%Z;dd*xB+s+(vUM3_CCDbAGqgg}0CvV749E37zq^x;5n0`T1EwHvYr416)_a@W~ zP*JOrj9YFMv&<;eni#iKeL6}+cQle{nzIQZY9WcL;G`?sTJ+cK38do&XG{0;u>MB6 z)wMrkw`!!`Iav3e1otL%B*3nXNlSbz-@dTyH-KckbBuS513eN^NJEEzAH>iB>|w*^ z^S4^4tZ0ePWI+#x%2@;Ry|HrI7-%d*!0Hl@+m3-I196L}N%7MSEX=b9~;HR$T4 zW+mD(bE`VquiAq3hPpheRWu9>3X2~5(}$aweoA4vlHWF4SbpN7h0U}1mYPOMUeLrA z?L4Xi`3hk=ek0SuC^B3A#c97Q^f&^dSAQX+xdfI8>Kz=J{%`hix9n_028hVYSUPpE)$68Lob<>tAP_ zmJl%;d7maDLvyE&QI zT1Wma1y^$cw_!`pbG$Sk9Xq`V=Nw*;Rs8xu49ki)aJ>A|MNAFhPJCUT^)3ahv z%m5E=B-wHFJSd4=S-8}hsL66IU>XGH^H@;MKys$TP*>(^-AI_fCtk1x*Xlg7ZNv@D z6=KUw2Rru=lx6I1?7oWFqlk1}-a)CQS{yy33akbdj&uAiC~Mf->}-NCBY0C(@n@KA z;C*f%n#pFV(Ichf@XMo*;5)tD;B(lU<1vBG-Is&%(X~JowmK#F38z#mgz+3y<$Ss=BGA8CV z=Y6_U-Ze=}Rq;tfb0`1eL?&r2;kJ`tn<-Hn+4NHL#Vpj+B}mPUEyPal&B7^u8Ve>Q zY=P92m{*b7ZwbKtN5=$y%T2Fh&gG?Ruf}iYnEF)1HPh4!IbZ>vfZruw-s@6dv(;P# zYTT`P7?NIeqNN;i0{i(I^;@mZARvD+6Xd30_nJOTN)n1@2GQaxxa(y7L=f%Y(_9~> zXx1k!OE1YU{F6jbF>p-ah}Pnmq+xY(OlnI!CRstNF!k;L0r?F;s9tpkacl{0-O7{p z4iyofR#)z6inVCJ>@832#R>cW+G_`--vQb1Cf7`CnhcTlTsp1gs-Lj^jg&Sxr9Yd= z)g!ep(tw{}iW!apud;(>1~rHJGfiv;ZyCSD3~pFBKe#2gpW5IWV)6U5DES#lgFLF! z(_LZDJmEoISOEDKP)h*< zKL8W}000O84zDvy8Eb6g!WRGln5O^$4FDtn00000001BW00000003lRbYWC^aAk8Y zd2MV803ZMW0000102lzj?X3QIG1CD6Ye)2>Fw+6!yqwCYFw+50O9ci1000010097B M0002(7XSbN02@B>4gdfE diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.yml b/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.yml index 6618650ef3..667ed7484b 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.yml +++ b/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.yml @@ -23,5 +23,6 @@ node_types: type: integer max_instances: type: integer - - \ No newline at end of file + multi_stage_design: + type: boolean + default: false \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.zip b/catalog-be/src/main/resources/import/tosca/heat-types/Generic_VF/Generic_VF.zip index d564813e2f68a26eaa8f328708ea07b66eecba39..85adfbc2a1dc9294861dd2894ed29bb9fb2e6504 100644 GIT binary patch literal 460 zcmWIWW@Zs#U|`^2nBCm!J-eUHT8oi^;Rq8010PV-JvA@2C^I=e%uTN{H>Y>f#=K?+ zp0@8cM{OOtCiR^OJtm|FwVqa=} zi-(;w2s-sGXtz;(>bqYa1;_Lb3Gx-(=wxdudZ&5a`nk#0sozwdY<<1jC9?g=%0t0= zoV6>}tit8jZ#BNL)1lLy>w?PLX+qqe);F&xev=D4kCxZ0esX8Zg0isI zrLjwR{iRlx^>1vNd-8$q(c164bFcnhcfIcVjsKRcIu`vKs%F3B{^P{UxA8{CC5P@V z<)S0P?t1Az0u^6;xc!MQD6c9-^GeXHsi#9DeEVlV%e}r$@$qM|uP1vYEF0!F_uj9S z`*!^A=j%oJj*V}%Mf`v6+Q0R~si;Hkk*AL(4~rlpRc1H4(;AZ9Q!Bmfy< Jz&K-I001U@x&i0hl$jhK=B8Jfo6|e-pxE@&6gs!rWIb6 zi_V|*TK??q&Qk02tAS5uTD@4zSL*5-7h3FiEaP+1Go$@ezFhEs6ke}(HA;5NxosQf ztlsi4u-Wu|GAsM!gR{H;FVA1G(tO71O7R=6ezIvgf@b=y|C;BoIIfw}t>zaJI%gvD zJd1+32i~m-2mC)Fp|Ff}z=m2k4HjrjUAWQ(#cEGq{U;qGUa;(?@ diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.json b/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.json new file mode 100644 index 0000000000..dd7b9769ee --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.json @@ -0,0 +1,21 @@ +{ + "payloadName": "extContrailCP.yml", + "contactId": "DS200P", + "name": "extContrailCP", + "description": "The AT&T Connection Point base type all other CP derive from", + "resourceIconPath": "network", + "resourceType": "CP", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Network Elements" + } + ] + } +], + "tags": [ + "extContrailCP" + ] +} diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.yml b/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.yml new file mode 100644 index 0000000000..e97c7ae674 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.yml @@ -0,0 +1,59 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.resource.cp.v2.extContrailCP: + derived_from: org.openecomp.resource.cp.v2.extCP + properties: + # copied from the org.openecomp.resource.cp.nodes.heat.network.contrail.Port type + 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: + # copied from the org.openecomp.resource.cp.nodes.heat.network.contrail.Port type + fq_name: + type: string + description: fq_name + status: SUPPORTED diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.zip b/catalog-be/src/main/resources/import/tosca/heat-types/extContrailCP/extContrailCP.zip new file mode 100644 index 0000000000000000000000000000000000000000..dddadde1ad4ba45af38c7300409b5f7a5c8f7e2d GIT binary patch literal 665 zcmWIWW@Zs#U|`^2SXZs$9W!Z4*8&fXB; z{3`|md&6JVOLQ6sKAaI9YN4RmvFpIqS-xts1^eFKnymZ#{mhz)sTZfM(KxHP>6r2P z^Y44zYqTzggltYud_U=Cu+Od&iFds2uz5dgSZkVprg!JgeMS3}l-nIN_wQr+P&oak zL!a0EHl3hPu{xUC&fDr|U*zBU*-vTHUhQ8cf3>>yEI)PS;`X2SPj_$Bayi>|=<&+K z-?_ZxXK1~c=pa?av_^gIrnUeh_fIb#e_u1FBek`k>2GV=0~L*!SudBM^Jhoxte*Q8vwSKnA+jo9#1l_ik@_$Fu(IL{}~4Jl#<3 zJr}~8=T7}9w{YvfKG&Tu@|S*uOaC;TFBBzhFlDB$G zjO5?)%L`(*MV0JW9CrJ~_Z>@rsR&hGpVP9(@AJywfG>Tw{o;~7T<1TQSiSH}^2N(m z|5yUN8JX-EaHS9xU>X4d1u%&vy>LOL7#SoOPFTDys#Lwqc!8glD*}lQ@MdKL>1PDO LWFW1;1mXbzDX<|b literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.json b/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.json new file mode 100644 index 0000000000..ff55d80135 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.json @@ -0,0 +1,21 @@ +{ + "payloadName": "extCP.yml", + "contactId": "DS200P", + "name": "ExtCP2", + "description": "The AT&T Connection Point base type all other CP derive from", + "resourceIconPath": "network", + "resourceType": "CP", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Network Elements" + } + ] + } +], + "tags": [ + "ExtCP2" + ] +} diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.yml b/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.yml new file mode 100644 index 0000000000..beae41d5ca --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.yml @@ -0,0 +1,8 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.resource.cp.v2.extCP: + derived_from: org.openecomp.resource.cp.nodes.network.Port + description: The SDC External Connection Point base type + capabilities: + port_mirroring: + type: org.openecomp.capabilities.PortMirroring \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.zip b/catalog-be/src/main/resources/import/tosca/heat-types/extCp2/extCp2.zip new file mode 100644 index 0000000000000000000000000000000000000000..81a9259e6d9b76f951e108cc41e2077df01f1d8a GIT binary patch literal 347 zcmWIWW@Zs#U|`^2=+4ph{*b>v?J$t%$;iOK38YgiN}L1qDsyvc`#1U>cHn9I?p4cf ze{iKi8gGxs#02|T{k)AQZmQpI`Sy0_5|L2ZS0^|9t^f5V$?~Wm|B)vuIfZUpuay); zN=~&(v{`O+boq|%-EZ4ckGy!^buHJNVbO5~QOV6yq(pr8nI@kwJ#(JX{~rJ8$kl>V z(_|hyE-m3t;=a$c_aL_iy<=T`tbQ?^I?}+>VRWRC%1bl!OxbrP zOEdZ7l&_1-r0nxKF1s8tI8KTFIKd7Bl(krO4^^3J$OoiLkC854sx>iU# z>{a6~pSmGqvPg*43-dY4_Z0~j?LM<<_WJJCnt7(%wl_KI$sKeN)V}hIbIN56x3u6z z+$~BmEI))4%5Ob&^FCPic!G|TOorsT4UL~&?@x*f?oj?ZZxe4_x50TqBdw+T+@*rf zP1NX^#r0aQaoVAu>I%!}9G|jqQjMSf{j)}wRwxCAW-}N*W?J{F_v+Ou;dOtGCaQVp zzGxwV-s%5%Xv%9pL=TE#Umz~wo7T^;m^Fgvn@Q&LA=SK~!v%)U!(JCi>N6%E^fkN?O46O*Wq5igq}zkSY4HOOuhxpnQs?L0Gv^5fG=cJ7dTaL!)! z^7YkktoH6Xb@}!Cm;JY!_cHH}RgO*mX}nnLjcK0Z(qC?%)DOk(sG_F;6RJz43f-KJf_0Bo7Ys%+sQjdg+ zDpIn2J8w^29bmEO!_FHnwodwEiTchlbx1ZIutvwgnrhDB{3}iX3 zBiza$on*UaJ@1Te_rnKgX4Ol~^PQb2@#CX~4MY3kHsf=DL~KNbdO1T|HfpR9>T;f& zAAKov(nGhcP7@Y;J4+-Y&`Z{{FK+{qy+jr!}{B+}Q8NV|eS=2SL|E)C=fV3g7Kw@A305^>; A(*OVf literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.yml b/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.yml index 3973598acd..53b453c67d 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.yml +++ b/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.yml @@ -10,7 +10,7 @@ node_types: description: ECOMP supported network types. network_role: type: string - required: ture + required: true description: > Unique label that defines the role that this network performs. example: vce oam network, vnat sr-iov1 network diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.zip b/catalog-be/src/main/resources/import/tosca/heat-types/extVl/extVl.zip index 80b1e1a1dd99653f5b1102bb792937f8ddc6af75..f69e5b40fba4493d1bb68f6041e6345e67095d61 100644 GIT binary patch literal 762 zcmWIWW@Zs#U|`^2nBCm!ov)k_l*Giqz{k$OzzGyhttbi0(W}hOSsUu>|JXplR)2re zmCNf~ly`jFAQZh-CrFc{tT=M5()F2U$}-kB{BHgGJy#{qlS?GxqO;Wb!xg`cb}nl@){#^j_&+gW#A`ez*&1b zbgY7-Is=y~-T6@w*3PgbW91=}$f(Ke4_34lUYu)a*J6>m@&j+FO>6v$)^7ix_VW8)$p_n)9T#%!WYzjG^TUNV!d7t#S6bFyO@H$3>P9v1 zjOEAhU zL3Q5oFD;6?p)-@#XUyBDXy3-AEoS$`tzhZSgNoMW8LxX%!phGbet$dZ(aReLum8AJ z`?}C#o#l_keabHmTK!hN=l|;TJb$521;Xcrbc@t1mb|_1vGT(r z+l`;qepOiRUS{-J@QLT%f0_6A_2(>}dTwKRRA2F%w4{6g;%yXVmOshf^yuYgPlg{F z_j6Co|Guux{8zNr=70CkEh~M;ZQ{L9rjD~cyvs?)Bk=pL^(TG>t#FxGC(!+Td*Sb! zFVo(wOjmp=AK=Z%B*K6zDXIVyBLf2?g94aFN|;_`fiEaGC{Px*t1BtFPDlVxfr>3a?{J!|lL<`T|s;l|7xpuy{4O;T1 zce0Xaq1!AQ$+we));{jnUNK!Jb?2cJU8AWnYT_qd-}}rK5#E39V(iy*3_Ww*)!ch8 zrBtR|oO#Hr$4m6#spFG3w7Yjr^YWQI(=@VKmQ_LAR`T&}TfeANwXX90581O8+Dc4x z%A|$LZS%4;6SuscdLSXk&6M@I?#rLovOaEA=+@NU#Cq);v+Cl9 zhwm!yP&(iHR)b@Lj{LXIwSnq_;@@l^t-mQD;NInd^m@vbN1}Qq6-E)B-?_trd;UXa@>LE|J`iOj3XJ-(UvEDk%=|OgxQm9l+)Yx8oP+|rV9j~p8HPcvHF!1kyj5wH}${TYJTwa_J=)8 z>kIhGSM2y15^>;5v#RLob=qPY^CbUYOcLTrp78kT;~Eo|EmdECZ??ZuQB%Pb0QdCX zKz?t})0Me7d;3qXI^@99_Py!-1$K+&H*%-PO^XwV>EubCHSNHe zlru}5?#Hb@>U8(FzLUo%_4p~m5y6SRjZ-XCirqcWFFA8>t&5$N$=t8!MA8z)K1V*_ z>Mautp6P2c|Ler1CoPj4668PE**s+zyE}=4yEX0T!ez@uSN~nQJTsuxseFx(?i==o zgLNs_3jID@o3!Bgf|sfCU+1glv3>}aV>P>_ZFy4l%6dV0&@jUc7$! z-J<$iYt3Ju7Gb$z$&&h0(z~#dA;6oF$({jMT&n;*4gv~b5?jo3LFE`3Bp8hUb{(E9 zdYKWOMz#YpXp!ys3bY3`bpZn!*$Qr*ZvJUND<(hh23rNA1H4(;KyG9L!s9^t6)@Hq F7yt`k49x%l literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.json b/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.json new file mode 100644 index 0000000000..a27717fe5b --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.json @@ -0,0 +1,21 @@ +{ + "payloadName": "portMirroringByPolicy.yml", + "contactId": "jh0003", + "name": "Port Mirroring Configuration By Policy", + "description": "A port mirroring configuration by policy object", + "resourceIconPath": "pmc", + "resourceType": "Configuration", + "categories": [ + { + "name": "Configuration", + "subcategories": [ + { + "name": "Configuration" + } + ] + } +], + "tags": [ + "Port Mirroring Configuration By Policy" + ] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.yml b/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.yml new file mode 100644 index 0000000000..0da5f689b4 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.yml @@ -0,0 +1,26 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.nodes.PortMirroringConfigurationByPolicy: + derived_from: tosca.nodes.Root + properties: + collector_node: + type: string + description: The name of the Collector Proxy + required: true + policy_name: + type: string + description: The name of the policy for selection of the collector interfaces + required: true + equip_model: + type: string + description: The name of the equipment type of the collector, i.e. Cisco 4500x + required: true + equip_vendor: + type: string + description: The name of the equipment vendor of the collector, i.e. Cisco + required: true + requirements: + - source: + capability: org.openecomp.capabilities.PortMirroring + occurrences: [1,UNBOUNDED] + diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.zip b/catalog-be/src/main/resources/import/tosca/heat-types/portMirroringByPolicy/portMirroringByPolicy.zip new file mode 100644 index 0000000000000000000000000000000000000000..a11e4f7842a8e313fbd7cf071c2d17bf5f5f57d3 GIT binary patch literal 909 zcmWIWW@Zs#U|`^2m>rPj{leOY^D2;ci;;mr3P=~^7nS&C78T_eW#*+jRR-keWF}YY zWfkY=^-i$oZ!!=#S}wfb`EU+T=j_>5h8Yrfc$_swy%xCNGBRm<|8A=Y&m@W6U(Q$W zzrMRV*Sy6=b}R3NM{dz_vLCrl#k2-3Xwf-u*6L=kdwZ_%+dXp|O{UCTQt)h7*W(`o zB9cNuJ_^MwI~!`cHici|nD8X$q=e*xrtD=d&rOcc^LYNEY}w7GbGonk)Fxb?GgDyE zjf-3x#RMpk&a_tfM6qGNyoVavk6Ac-?DDsywTPWJUX zY#`A3ePR*2Jj0@pCf{kfkwIE6;T(|%XHJN*%b1pA^WM%?ZFvC3B{ zW%ioRyS7Hci|^@qOy7}f!7uo^%vW@kS&Ur>V~@2)%E=J)m5}-@VW8HR^Tz=iXEPU(EL3-80AQt6p$BmVIf+ zPF$H-`p$agohR!f7G`h0ST|2ZX8p@6ty8jQIIiAMcz*NhvswQ(MC!hure7%HE+62{ z$YjreD}|~6qXh&Mz$Cu($^})!$RNSs@%_-7t6`TJRaTC rWUESEr$kt$TxMJ``FQ6Wpq0lsj)1KW@MdKLxtR$FuLJ1?OduWrdO2{E literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.json b/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.json new file mode 100644 index 0000000000..c34625a3c9 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.json @@ -0,0 +1,21 @@ +{ + "payloadName": "serviceProxy.yml", + "contactId": "jh0003", + "name": "serviceProxy", + "description": "Represents a proxy to a service VFC.", + "resourceIconPath": "defaulticon", + "resourceType": "ServiceProxy", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Abstract" + } + ] + } +], + "tags": [ + "serviceProxy" + ] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.yml b/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.yml new file mode 100644 index 0000000000..cf7ec5af10 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.yml @@ -0,0 +1,4 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.nodes.ServiceProxy: + derived_from: tosca.nodes.Root \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.zip b/catalog-be/src/main/resources/import/tosca/heat-types/serviceProxy/serviceProxy.zip new file mode 100644 index 0000000000000000000000000000000000000000..9f0b60d1dfd86df2a96d1fc2221ec161d91415c3 GIT binary patch literal 557 zcmWIWW@Zs#U|`^2;I8NQ-p083ZZ4452gCwET%1}|mYJLyP?TR$saKhsqucAqb=ZK1 z<$dEHMSX*prt3A{GP`UrcNK_s6I%AKcJd=j-7|WxlM0u&G;>>f8)gOUKD6yeyyWw$ zreE{?t1fuGwh{GIcrUu`?BycGUz|aK0;<;wvbpm!9(OE1wY~qAZ&Q);B4^e9Zo`Vs zAN&Dur)B4hc&Dq^J6`}fjgf&t5Z!56#rb);6CAq_83?q#=l<6|VYA1<+1p(sK5pvh zntt@KiL7bRkmiC_Z&RB+==Iw>zrQp_ed?rx5Z48JIyA1_3JQg>)@1CW!2(Xeq!^R$ywix z=YR2hRwK%*_w%mk1Dz-F4?~`Mr6Xu=jnGfDC*1-~U=4CGy_~cr!AIFyM|GU>Gnk rGAMv3AV7~PWZl?;52Od8dp5dmP+$glv$BDdFacpLke&q$bp{3iC-Tpk literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py index c72c2c394f..8b16a72ab3 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py @@ -42,6 +42,8 @@ def importHeatTypes(beHost, bePort, adminUser, fileDir, updateversion): "Generic_Service", "contrailNetworkRules", "contrailPort", + "portMirroring", + "serviceProxy", "contrailV2NetworkRules", "contrailV2VirtualNetwork", "securityRules", @@ -52,9 +54,10 @@ def importHeatTypes(beHost, bePort, adminUser, fileDir, updateversion): "contrailV2VLANSubInterface", "multiFlavorVFC", "vnfConfiguration", - "underlayVpn", - "overlayTunnel", - "genericNeutronNet" + "extCp2", + "extNeutronCP", + "extContrailCP", + "portMirroringByPolicy" ] responseCodes = [200, 201] diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeAll.py b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeAll.py index 3d7d9a9bbf..b6e390992e 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeAll.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeAll.py @@ -122,11 +122,7 @@ def main(argv): fileLocation = baseFileLocation + "heat-types/" resultsHeat = importHeatTypes(beHost, bePort, adminUser, fileLocation, updateversion) handleResults(resultsHeat, updateversion) - - fileLocation = baseFileLocation + "onap-types/" - resultsHeat = importOnapTypes(beHost, bePort, adminUser, fileLocation, updateversion) - handleResults(resultsHeat, updateversion) - + fileLocation = baseFileLocation + "group-types/" importGroupTypes(beHost, bePort, adminUser, False, fileLocation) diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py b/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py new file mode 100644 index 0000000000..3d7d9a9bbf --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py @@ -0,0 +1,140 @@ +import pycurl +import sys, getopt, os +from StringIO import StringIO +import json +import copy +import time +#from importNormativeElements import createNormativeElement +from importNormativeElements import * +from importNormativeTypes import importNormativeTypes +from importHeatTypes import importHeatTypes +from importOnapTypes import importOnapTypes +from importNormativeCapabilities import importNormativeCapabilities +from importCategoryTypes import importCategories +from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType +from importDataTypes import importDataTypes +from importGroupTypes import importGroupTypes +from importPolicyTypes import importPolicyTypes +from importCommon import * +import importCommon + +################################################################################################################################################################################################# +# # +# Import all users from a given file # +# # +# activation : # +# python importNormativeAll.py [-i | --ip=] [-p | --port= ] [-u | --user= ] [-d | --debug=] # +# [-v | --updateversion=] # +# # +# shortest activation (be host = localhost, be port = 8080, user = jh0003): # # # +# python importNormativeAll.py # +# # +################################################################################################################################################################################################# + +def usage(): + print sys.argv[0], '[-i | --ip=] [-p | --port= ] [-u | --user= ] [-d | --debug=] [-v | --updateversion=]' + +def handleResults(results, updateversion): + printFrameLine() + for result in results: + printNameAndReturnCode(result[0], result[1]) + printFrameLine() + + responseCodes = [200, 201] + + if(updateversion == 'false'): + responseCodes = [200, 201, 409] + + failedResults = filter(lambda x: x[1] == None or x[1] not in responseCodes, results) + if (len(failedResults) > 0): + errorAndExit(1, None) + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + debugf = None + updateversion = 'true' + importCommon.debugFlag = False + + try: + opts, args = getopt.getopt(argv,"i:p:u:d:v:h",["ip=","port=","user=","debug=","updateversion="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + #print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-d", "--debug"): + print arg + debugf = bool(arg.lower() == "true" or arg.lower() == "yes") + elif opt in ("-v", "--updateversion"): + print arg + if (arg.lower() == "false" or arg.lower() == "no"): + updateversion = 'false' + + print 'be host =',beHost,', be port =', bePort,', user =', adminUser, ', debug =', debugf, ', updateversion =', updateversion + + if (debugf != None): + print 'set debug mode to ' + str(debugf) + importCommon.debugFlag = debugf + + if ( beHost == None ): + usage() + sys.exit(3) + + print sys.argv[0] + pathdir = os.path.dirname(os.path.realpath(sys.argv[0])) + debug("path dir =" + pathdir) + + baseFileLocation = pathdir + "/../../../import/tosca/" + + fileLocation = baseFileLocation + "data-types/" + importDataTypes(beHost, bePort, adminUser, False, fileLocation) + + print 'sleep until data type cache is updated' + time.sleep( 70 ) + + fileLocation = baseFileLocation + "capability-types/" + importNormativeCapabilities(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "interface-lifecycle-types/" + importNormativeInterfaceLifecycleType(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "categories/" + importCategories(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "normative-types/" + results = importNormativeTypes(beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(results, updateversion) + + fileLocation = baseFileLocation + "heat-types/" + resultsHeat = importHeatTypes(beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(resultsHeat, updateversion) + + fileLocation = baseFileLocation + "onap-types/" + resultsHeat = importOnapTypes(beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(resultsHeat, updateversion) + + fileLocation = baseFileLocation + "group-types/" + importGroupTypes(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "policy-types/" + importPolicyTypes(beHost, bePort, adminUser, False, fileLocation) + + errorAndExit(0, None) + +if __name__ == "__main__": + main(sys.argv[1:]) + diff --git a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json index c518855860..d239a15c72 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json +++ b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json @@ -1,54 +1,20 @@ { "heat": [ - "globalNetwork", - "globalPort", - "globalCompute", - "volume", - "cinderVolume", - "contrailVirtualNetwork", - "neutronNet", - "neutronPort", - "novaServer", - "extVl", - "internalVl", - "extCp", - "vl", - "eline", - "abstractSubstitute", - "Generic_VFC", - "Generic_VF", - "Generic_PNF", - "Generic_Service", - "contrailNetworkRules", "contrailPort", - "contrailV2NetworkRules", - "contrailV2VirtualNetwork", - "securityRules", - "contrailAbstractSubstitute", - "contrailCompute", + "extCp", "contrailV2VirtualMachineInterface", - "subInterface", - "contrailV2VLANSubInterface", - "multiFlavorVFC", - "vnfConfiguration", - "underlayVpn", - "overlayTunnel", - "genericNeutronNet" + "neutronPort", + "Generic_PNF", + "portMirroring", + "Generic_VF", + "serviceProxy", + "extCp2", + "extContrailCP", + "vnfConfiguration", + "extVl", + "multiFlavorVFC", + "portMirroringByPolicy" ], "normative": [ - "root", - "compute", - "softwareComponent", - "webServer", - "webApplication", - "DBMS", - "database", - "objectStorage", - "blockStorage", - "containerRuntime", - "containerApplication", - "loadBalancer", - "port", - "network" ] } \ No newline at end of file diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeNormative.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeNormative.py index 4d0ec291f5..69a51f41f1 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/upgradeNormative.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeNormative.py @@ -114,10 +114,6 @@ def main(argv): resultsHeat = upgradeTypesPerConfigFile(beHost, bePort, adminUser, baseFileLocation, updateversion) handleResults(resultsHeat, 'false') - fileLocation = baseFileLocation + "onap-types/" - resultsHeat = importOnapTypes(beHost, bePort, adminUser, fileLocation, updateversion) - handleResults(resultsHeat, updateversion) - errorAndExit(0, None) if __name__ == "__main__": diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py new file mode 100644 index 0000000000..4d0ec291f5 --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py @@ -0,0 +1,124 @@ +import pycurl +import sys, getopt, os +from StringIO import StringIO +import json +import copy +import time +from importCategoryTypes import importCategories +from upgradeHeatAndNormativeTypes import upgradeTypesPerConfigFile +from importDataTypes import importDataTypes +from importPolicyTypes import importPolicyTypes +from importGroupTypes import importGroupTypes +from importNormativeCapabilities import importNormativeCapabilities +from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType +from importOnapTypes import importOnapTypes + + +from importCommon import * +import importCommon + +################################################################################################################################################################################################# +# # +# Upgrades the normative types # +# # +# activation : # +# python upgradeNormative.py [-i | --ip=] [-p | --port= ] [-u | --user= ] [-d | --debug=] # +# # +# # +# shortest activation (be host = localhost, be port = 8080, user = jh0003): # # # +# python upgradeNormative.py # +# # +################################################################################################################################################################################################# + +def usage(): + print sys.argv[0], '[-i | --ip=] [-p | --port= ] [-u | --user= ] [-d | --debug=]' + +def handleResults(results, updateversion): + printFrameLine() + for result in results: + printNameAndReturnCode(result[0], result[1]) + printFrameLine() + + failedResults = filter(lambda x: x[1] == None or x[1] not in [200, 201, 409], results) + if (len(failedResults) > 0): + errorAndExit(1, None) + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + debugf = None + updateversion = 'true' + importCommon.debugFlag = False + + try: + opts, args = getopt.getopt(argv,"i:p:u:d:h",["ip=","port=","user=","debug="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + #print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-d", "--debug"): + print arg + debugf = bool(arg.lower() == "true" or arg.lower() == "yes") + + print 'be host =',beHost,', be port =', bePort,', user =', adminUser, ', debug =', debugf + + if (debugf != None): + print 'set debug mode to ' + str(debugf) + importCommon.debugFlag = debugf + + if ( beHost == None ): + usage() + sys.exit(3) + + print sys.argv[0] + pathdir = os.path.dirname(os.path.realpath(sys.argv[0])) + debug("path dir =" + pathdir) + + baseFileLocation = pathdir + "/../../../import/tosca/" + + fileLocation = baseFileLocation + "categories/" + importCategories(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "data-types/" + importDataTypes(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "policy-types/" + importPolicyTypes(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "group-types/" + importGroupTypes(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "capability-types/" + importNormativeCapabilities(beHost, bePort, adminUser, False, fileLocation) + + fileLocation = baseFileLocation + "interface-lifecycle-types/" + importNormativeInterfaceLifecycleType(beHost, bePort, adminUser, False, fileLocation) + + print 'sleep until data type cache is updated' + time.sleep( 70 ) + + resultsHeat = upgradeTypesPerConfigFile(beHost, bePort, adminUser, baseFileLocation, updateversion) + handleResults(resultsHeat, 'false') + + fileLocation = baseFileLocation + "onap-types/" + resultsHeat = importOnapTypes(beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(resultsHeat, updateversion) + + errorAndExit(0, None) + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/catalog-be/src/test/java/org/openecomp/sdc/ZipUtil.java b/catalog-be/src/test/java/org/openecomp/sdc/ZipUtil.java index d55d5752c1..c3f211f7ab 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/ZipUtil.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/ZipUtil.java @@ -21,8 +21,6 @@ package org.openecomp.sdc; import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/DummyConfigurationManager.java b/catalog-be/src/test/java/org/openecomp/sdc/be/DummyConfigurationManager.java new file mode 100644 index 0000000000..a6c8dc4f0c --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/DummyConfigurationManager.java @@ -0,0 +1,40 @@ +package org.openecomp.sdc.be; + +import static org.mockito.Mockito.mock; + +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.be.config.DistributionEngineConfiguration; +import org.openecomp.sdc.common.api.ConfigurationListener; +import org.openecomp.sdc.common.api.ConfigurationSource; + +public class DummyConfigurationManager { + + private DistributionEngineConfiguration distributionConfigurationMock = mock(DistributionEngineConfiguration.class); + private Configuration configurationMock = mock(Configuration.class); + + public DummyConfigurationManager() { + new ConfigurationManager(new DummyConfigurationSource()); + } + + public class DummyConfigurationSource implements ConfigurationSource { + + @SuppressWarnings("unchecked") + @Override + public T getAndWatchConfiguration(Class className, ConfigurationListener configurationListener) { + if (className.equals(DistributionEngineConfiguration.class)) { + return (T) distributionConfigurationMock; + } + if (className.equals(Configuration.class)) { + return (T) configurationMock; + } + return null; + } + + @Override + public void addWatchConfiguration(Class className, ConfigurationListener configurationListener) { + + } + } + +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/AuditingManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/AuditingManagerTest.java index dff0e3c729..87dfbc45de 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/AuditingManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/AuditingManagerTest.java @@ -25,8 +25,6 @@ import static org.mockito.Mockito.when; import java.util.EnumMap; import java.util.UUID; -import junit.framework.Assert; - import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -38,10 +36,8 @@ import org.openecomp.sdc.be.dao.impl.AuditingDao; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.common.util.ThreadLocalsHolder; -import org.slf4j.LoggerFactory; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; +import junit.framework.Assert; public class AuditingManagerTest extends BaseConfDependentTest{ diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ComponentBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ComponentBusinessLogicTest.java index 90f5b19acc..7774b7f412 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ComponentBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ComponentBusinessLogicTest.java @@ -20,49 +20,108 @@ package org.openecomp.sdc.be.components; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; + +import java.util.HashMap; import java.util.List; +import java.util.Map; +import org.junit.BeforeClass; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.openecomp.sdc.be.DummyConfigurationManager; +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; +import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.exception.ResponseFormat; import fj.data.Either; +@RunWith(MockitoJUnitRunner.class) public class ComponentBusinessLogicTest { - ComponentBusinessLogic businessLogic = new ComponentBusinessLogic() { + private static final User USER = new User(); + private static final String ARTIFACT_LABEL = "toscaArtifact1"; + private static final String ARTIFACT_LABEL2 = "toscaArtifact2"; + + @InjectMocks + private ComponentBusinessLogic testInstance = new ComponentBusinessLogic() { @Override public Either, ResponseFormat> deleteMarkedComponents() { - // TODO Auto-generated method stub return null; } @Override public ComponentInstanceBusinessLogic getComponentInstanceBL() { - // TODO Auto-generated method stub return null; } @Override public Either, ResponseFormat> getComponentInstancesFilteredByPropertiesAndInputs(String componentId, ComponentTypeEnum componentTypeEnum, String userId, String searchText) { - // TODO Auto-generated method stub return null; } @Override public Either getUiComponentDataTransferByComponentId(String componentId, List dataParamsToReturn) { - // TODO Auto-generated method stub return null; } }; + @Mock + private ArtifactsBusinessLogic artifactsBusinessLogic; + + @BeforeClass + public static void setUp() throws Exception { + new DummyConfigurationManager(); + } + + @SuppressWarnings("unchecked") @Test - public void testGetRequirementsAndCapabilities() { - // businessLogic.getRequirementsAndCapabilities(componentId, - // componentTypeEnum); + public void setToscaArtifactsPlaceHolders_normalizeArtifactName() throws Exception { + Resource resource = new ResourceBuilder().setUniqueId("uid") + .setComponentType(ComponentTypeEnum.RESOURCE) + .setSystemName("myResource") + .build(); + Map artifactsFromConfig = new HashMap<>(); + artifactsFromConfig.put(ARTIFACT_LABEL, buildArtifactMap("artifact:not normalized.yml")); + artifactsFromConfig.put(ARTIFACT_LABEL2, buildArtifactMap("alreadyNormalized.csar")); + when(ConfigurationManager.getConfigurationManager().getConfiguration().getToscaArtifacts()).thenReturn(artifactsFromConfig); + when(artifactsBusinessLogic.createArtifactPlaceHolderInfo(resource.getUniqueId(), ARTIFACT_LABEL, (Map) artifactsFromConfig.get(ARTIFACT_LABEL), USER, ArtifactGroupTypeEnum.TOSCA)) + .thenReturn(buildArtifactDef(ARTIFACT_LABEL)); + when(artifactsBusinessLogic.createArtifactPlaceHolderInfo(resource.getUniqueId(), ARTIFACT_LABEL2, (Map) artifactsFromConfig.get(ARTIFACT_LABEL2), USER, ArtifactGroupTypeEnum.TOSCA)) + .thenReturn(buildArtifactDef(ARTIFACT_LABEL2)); + testInstance.setToscaArtifactsPlaceHolders(resource, USER); + + Map toscaArtifacts = resource.getToscaArtifacts(); + assertThat(toscaArtifacts).hasSize(2); + ArtifactDefinition artifactDefinition = toscaArtifacts.get(ARTIFACT_LABEL); + assertThat(artifactDefinition.getArtifactName()).isEqualTo("resource-myResourceartifactnot-normalized.yml"); + ArtifactDefinition artifactDefinition2 = toscaArtifacts.get(ARTIFACT_LABEL2); + assertThat(artifactDefinition2.getArtifactName()).isEqualTo("resource-myResourcealreadyNormalized.csar"); + } + + private Map buildArtifactMap(String artifactName) { + Map artifact = new HashMap<>(); + artifact.put("artifactName", artifactName); + return artifact; + } + + private ArtifactDefinition buildArtifactDef(String artifactLabel) { + ArtifactDefinition artifactDefinition = new ArtifactDefinition(); + artifactDefinition.setArtifactLabel(artifactLabel); + return artifactDefinition; } } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/GroupBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/GroupBusinessLogicTest.java index 0dceaed4f2..9bf7f16a50 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/GroupBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/GroupBusinessLogicTest.java @@ -20,15 +20,8 @@ package org.openecomp.sdc.be.components; -import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; - import javax.servlet.ServletContext; import org.junit.Before; @@ -43,8 +36,6 @@ import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.GroupDefinition; -import org.openecomp.sdc.be.model.GroupProperty; -import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.IGraphLockOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; @@ -53,11 +44,8 @@ import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; -import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import fj.data.Either; /** * tests GroupBusinessLogic class * @author ns019t diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java index be3bf9b234..2a34baeb0f 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java @@ -20,28 +20,17 @@ package org.openecomp.sdc.be.components; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.openecomp.sdc.be.components.impl.HealthCheckBusinessLogic; -import org.openecomp.sdc.be.dao.cassandra.schema.SdcSchemaUtils; -import org.openecomp.sdc.be.dao.titan.TitanGenericDao; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.dao.utils.UserStatusEnum; -import org.openecomp.sdc.be.resources.data.UserData; +import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; - -import com.datastax.driver.core.Cluster; - -import fj.data.Either; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; public class HealthCheckBusinessLogicTest { HealthCheckBusinessLogic healthCheckBusinessLogic = new HealthCheckBusinessLogic(); @@ -58,8 +47,8 @@ public class HealthCheckBusinessLogicTest { statusChanged = healthCheckBusinessLogic.anyStatusChanged(checkInfosLeft, checkInfosRight); assertFalse("check false", statusChanged); - HealthCheckInfo checkInfoTitanUp = new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.UP, null, null); - HealthCheckInfo checkInfoTitanDown = new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.DOWN, null, null); + HealthCheckInfo checkInfoTitanUp = new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.UP, null, null); + HealthCheckInfo checkInfoTitanDown = new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.DOWN, null, null); /* * HealthCheckInfo checkInfoUebUp = new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.UP, null, null); HealthCheckInfo checkInfoUebDown = new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.DOWN, null, null); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java index 1309af8ff7..572804636d 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java @@ -20,10 +20,17 @@ package org.openecomp.sdc.be.components; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import fj.data.Either; -import junit.framework.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; + import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -41,7 +48,6 @@ import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.operations.api.IPropertyOperation; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.resources.data.EntryData; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; @@ -54,16 +60,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; -import javax.servlet.ServletContext; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import fj.data.Either; +import junit.framework.Assert; public class PropertyBusinessLogicTest { @@ -195,7 +196,7 @@ public class PropertyBusinessLogicTest { resource.setUniqueId(resourceId); Mockito.when(toscaOperationFacade.getToscaElement(resourceId)).thenReturn(Either.left(resource)); - Either, ResponseFormat> notFoundProperty = bl.getProperty(resourceId, property1.getUniqueId(), user.getUserId()); + Either, ResponseFormat> notFoundProperty = bl.getProperty(resourceId, "invalidId", user.getUserId()); assertTrue(notFoundProperty.isRight()); Mockito.verify(componentsUtils).getResponseFormat(ActionStatus.PROPERTY_NOT_FOUND, ""); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java index c545474f5d..30e12e85d0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java @@ -156,7 +156,7 @@ public class ResourceImportManagerTest { // Mockito.verify(log).error(Mockito.anyString(), Mockito.anyString(), // Mockito.anyString()); - Mockito.verify(resourceBusinessLogic, Mockito.times(0)).createOrUpdateResourceByImport(Mockito.any(Resource.class), Mockito.eq(user), Mockito.eq(true), Mockito.eq(false), Mockito.eq(true), Mockito.eq(null)); + Mockito.verify(resourceBusinessLogic, Mockito.times(0)).createOrUpdateResourceByImport(Mockito.any(Resource.class), Mockito.eq(user), Mockito.eq(true), Mockito.eq(false), Mockito.eq(true), Mockito.eq(null), Mockito.eq(null), Mockito.eq(false)); Mockito.verify(resourceBusinessLogic, Mockito.times(0)).propagateStateToCertified(Mockito.eq(user), Mockito.any(Resource.class), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.eq(false), Mockito.eq(true), Mockito.eq(false)); @@ -181,7 +181,7 @@ public class ResourceImportManagerTest { testSetCapabilities(resource); Mockito.verify(resourceBusinessLogic, Mockito.times(1)).propagateStateToCertified(Mockito.eq(user), Mockito.eq(resource), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.eq(false), Mockito.eq(true), Mockito.eq(false)); - Mockito.verify(resourceBusinessLogic, Mockito.times(1)).createOrUpdateResourceByImport(resource, user, true, false, true, null); + Mockito.verify(resourceBusinessLogic, Mockito.times(1)).createOrUpdateResourceByImport(resource, user, true, false, true, null, null, false); } @@ -206,7 +206,7 @@ public class ResourceImportManagerTest { private void setResourceBusinessLogicMock() { when(resourceBusinessLogic.getUserAdmin()).thenReturn(userAdmin); - when(resourceBusinessLogic.createOrUpdateResourceByImport(Mockito.any(Resource.class), Mockito.any(User.class), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.eq(null))) + when(resourceBusinessLogic.createOrUpdateResourceByImport(Mockito.any(Resource.class), Mockito.any(User.class), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.eq(null), Mockito.eq(null), Mockito.eq(false))) .thenAnswer(new Answer, ResponseFormat>>() { public Either, ResponseFormat> answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); @@ -250,6 +250,7 @@ public class ResourceImportManagerTest { private UploadResourceInfo createDummyResourceMD() { UploadResourceInfo resourceMD = new UploadResourceInfo(); resourceMD.setName("tosca.nodes.BlockStorage"); + resourceMD.setPayloadName("payLoad"); resourceMD.addSubCategory("Generic", "Infrastructure"); resourceMD.setContactId("ya107f"); resourceMD.setResourceIconPath("defaulticon"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceBusinessLogicTest.java index 95845c3660..1af1ac3070 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ServiceBusinessLogicTest.java @@ -44,6 +44,7 @@ import org.openecomp.sdc.be.auditing.impl.AuditingManager; import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.components.impl.ResponseFormatManager; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao; @@ -104,6 +105,7 @@ public class ServiceBusinessLogicTest { TitanDao mockTitanDao = Mockito.mock(TitanDao.class); ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class); CacheMangerOperation cacheManager = Mockito.mock(CacheMangerOperation.class); + GenericTypeBusinessLogic genericTypeBusinessLogic = Mockito.mock(GenericTypeBusinessLogic.class); User user = null; Service serviceResponse = null; @@ -154,7 +156,7 @@ public class ServiceBusinessLogicTest { // artifact bussinesslogic ArtifactDefinition artifactDef = new ArtifactDefinition(); - when(artifactBl.createArtifactPlaceHolderInfo(Mockito.anyString(), Mockito.anyString(), Mockito.anyMap(), Mockito.any(User.class), Mockito.any(ArtifactGroupTypeEnum.class))).thenReturn(artifactDef); + when(artifactBl.createArtifactPlaceHolderInfo(Mockito.any(), Mockito.anyString(), Mockito.anyMap(), Mockito.any(User.class), Mockito.any(ArtifactGroupTypeEnum.class))).thenReturn(artifactDef); // createService serviceResponse = createServiceObject(true); @@ -177,7 +179,7 @@ public class ServiceBusinessLogicTest { bl.setGraphLockOperation(graphLockOperation); bl.setTitanGenericDao(mockTitanDao); bl.setToscaOperationFacade(toscaOperationFacade); - + bl.setGenericTypeBusinessLogic(genericTypeBusinessLogic); componentsUtils.Init(); componentsUtils.setAuditingManager(auditingManager); bl.setComponentsUtils(componentsUtils); @@ -209,6 +211,7 @@ public class ServiceBusinessLogicTest { @Test public void testHappyScenario() { Service service = createServiceObject(false); + when(genericTypeBusinessLogic.fetchDerivedFromGenericType(service)).thenReturn(Either.left(genericService)); Either createResponse = bl.createService(service, user); if (createResponse.isRight()) { @@ -744,8 +747,6 @@ public class ServiceBusinessLogicTest { Either eitherDelete = Either.left(new Resource()); when(toscaOperationFacade.deleteToscaComponent(resourceFree)).thenReturn(eitherDelete); - when(artifactBl.deleteAllComponentArtifactsIfNotOnGraph(artifacts)).thenReturn(StorageOperationStatus.OK); - Either, ResponseFormat> deleteMarkedResources = bl.deleteMarkedComponents(); assertTrue(deleteMarkedResources.isLeft()); List resourceIdList = deleteMarkedResources.left().value(); @@ -753,7 +754,6 @@ public class ServiceBusinessLogicTest { assertTrue(resourceIdList.contains(resourceFree)); assertFalse(resourceIdList.contains(resourceInUse)); - Mockito.verify(artifactBl, Mockito.times(1)).deleteAllComponentArtifactsIfNotOnGraph(artifacts); } private Service createServiceObject(boolean afterCreate) { @@ -1004,6 +1004,7 @@ public class ServiceBusinessLogicTest { public void testDerivedFromGeneric() { Service service = createServiceObject(true); when(toscaOperationFacade.createToscaComponent(service)).thenReturn(Either.left(service)); + when(genericTypeBusinessLogic.fetchDerivedFromGenericType(service)).thenReturn(Either.left(genericService)); Either createResponse = bl.createService(service, user); assertTrue(createResponse.isLeft()); service = createResponse.left().value(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java index be55cbd12a..90a02a2fc5 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.components.clean; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineConfigTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineConfigTest.java index 7ad93226c7..8d48a4c320 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineConfigTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineConfigTest.java @@ -20,7 +20,8 @@ package org.openecomp.sdc.be.components.distribution.engine; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.File; import java.util.ArrayList; @@ -28,7 +29,6 @@ import java.util.List; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.be.components.distribution.engine.DistributionEngine; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.DistributionEngineConfiguration; import org.openecomp.sdc.be.config.DistributionEngineConfiguration.ComponentArtifactTypesConfig; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineHealthCheckTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineHealthCheckTest.java index b3a254f531..990ea4f99b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineHealthCheckTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineHealthCheckTest.java @@ -30,10 +30,6 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; import org.openecomp.sdc.be.components.BaseConfDependentTest; -import org.openecomp.sdc.be.components.distribution.engine.CambriaErrorResponse; -import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; -import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineClusterHealth; -import org.openecomp.sdc.be.components.distribution.engine.UebHealthCheckCall; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTaskTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTaskTest.java index de7b84fa82..5bf12d56bc 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTaskTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTaskTest.java @@ -27,20 +27,15 @@ import static org.mockito.Mockito.when; import java.io.File; import java.util.ArrayList; -import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; -import org.openecomp.sdc.be.components.distribution.engine.CambriaErrorResponse; -import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; -import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask; -import org.openecomp.sdc.be.components.distribution.engine.SubscriberTypeEnum; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.DistributionEngineConfiguration; import org.openecomp.sdc.be.config.DistributionEngineConfiguration.CreateTopicConfig; @@ -63,8 +58,8 @@ public class DistributionEngineInitTaskTest { // public static final IAuditingDao iAuditingDao = // Mockito.mock(AuditingDao.class); - @Before - public void setup() { + @BeforeClass + public static void setup() { // ExternalConfiguration.setAppName("distribEngine1"); ExternalConfiguration.setAppName("catalog-be"); ExternalConfiguration.setConfigDir("src/test/resources/config"); @@ -128,11 +123,11 @@ public class DistributionEngineInitTaskTest { String realNotifTopic = notifTopic + "-" + envName.toUpperCase(); String realStatusTopic = statusTopic + "-" + envName.toUpperCase(); - when(cambriaHandler.createTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.eq(realNotifTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); - when(cambriaHandler.createTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.eq(realStatusTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); + when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realNotifTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); + when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realStatusTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.OK); - when(cambriaHandler.registerToTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(SubscriberTypeEnum.class))) + when(cambriaHandler.registerToTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) .thenReturn(cambriaErrorResponse); DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null); @@ -159,7 +154,6 @@ public class DistributionEngineInitTaskTest { List uebServers = new ArrayList<>(); uebServers.add("server1"); - CambriaErrorResponse cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.NOT_FOUND); Either, CambriaErrorResponse> left = Either.left(topics); when(cambriaHandler.getTopics(Mockito.any(List.class))).thenReturn(left); @@ -177,8 +171,8 @@ public class DistributionEngineInitTaskTest { createTopic.setReplicationCount(1); deConfiguration.setCreateTopic(createTopic); - cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.OK); - when(cambriaHandler.registerToTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(SubscriberTypeEnum.class))) + CambriaErrorResponse cambriaErrorResponse = new CambriaErrorResponse(CambriaOperationStatus.OK); + when(cambriaHandler.registerToTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) .thenReturn(cambriaErrorResponse); DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null); @@ -224,15 +218,16 @@ public class DistributionEngineInitTaskTest { String realNotifTopic = notifTopic + "-" + envName.toUpperCase(); String realStatusTopic = statusTopic + "-" + envName.toUpperCase(); - when(cambriaHandler.createTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.eq(realNotifTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); - when(cambriaHandler.createTopic(Mockito.any(Collection.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.eq(realStatusTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); + when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realNotifTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); + when(cambriaHandler.createTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.eq(realStatusTopic), Mockito.eq(1), Mockito.eq(1))).thenReturn(cambriaErrorResponse); - when(cambriaHandler.registerToTopic(Mockito.any(Collection.class), Mockito.eq(realNotifTopic), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(SubscriberTypeEnum.class))) + when(cambriaHandler.registerToTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(SubscriberTypeEnum.class))) .thenReturn(new CambriaErrorResponse(CambriaOperationStatus.OK)); - when(cambriaHandler.registerToTopic(Mockito.any(Collection.class), Mockito.eq(realStatusTopic), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class), Mockito.any(SubscriberTypeEnum.class))) + when(cambriaHandler.registerToTopic(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(SubscriberTypeEnum.class))) .thenReturn(new CambriaErrorResponse(CambriaOperationStatus.CONNNECTION_ERROR)); + DistributionEngineInitTask initTask = new DistributionEngineInitTask(0l, deConfiguration, envName, new AtomicBoolean(false), componentsUtils, null); initTask.setCambriaHandler(cambriaHandler); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java index 1bc8c47f8c..4144dcf620 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java @@ -4,11 +4,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.GroupDefinition; -import org.openecomp.sdc.be.model.GroupInstance; import org.openecomp.sdc.be.model.GroupInstanceProperty; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogicTest.java index f2053535ad..e2fceddcf6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AdditionalInformationBusinessLogicTest.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.be.components.impl; import java.util.List; -import javax.annotation.Generated; import javax.servlet.ServletContext; import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java index 5de6762bdd..c57f2a65af 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactBusinessLogicTest.java @@ -20,20 +20,36 @@ package org.openecomp.sdc.be.components.impl; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; +import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_ENV_NAME; +import static org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.HEAT_VF_ENV_NAME; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.codehaus.jackson.map.annotate.JsonSerialize; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.mockito.InjectMocks; +import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ArtifactBuilder; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -45,10 +61,13 @@ import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.ArtifactType; +import org.openecomp.sdc.be.model.HeatParameterDefinition; import org.openecomp.sdc.be.model.InterfaceDefinition; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; +import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.operations.api.IElementOperation; import org.openecomp.sdc.be.model.operations.api.IInterfaceLifecycleOperation; @@ -57,6 +76,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.ArtifactOperation; import org.openecomp.sdc.be.resources.data.ESArtifactData; import org.openecomp.sdc.be.servlets.RepresentationUtils; +import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; import org.openecomp.sdc.common.api.ConfigurationSource; @@ -64,30 +84,40 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; -import static org.junit.Assert.*; -import static org.mockito.Mockito.when; +import fj.data.Either; public class ArtifactBusinessLogicTest { + public static final User USER = new User("John", "Doh", "jh0003", "jh0003@gmail.com", "ADMIN", System.currentTimeMillis()); static ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"); static ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); @InjectMocks - static ArtifactsBusinessLogic artifactBL = new ArtifactsBusinessLogic(); - - public static final ArtifactOperation artifactOperation = Mockito.mock(ArtifactOperation.class); - public static final ComponentsUtils componentsUtils = Mockito.mock(ComponentsUtils.class); - public static final IInterfaceLifecycleOperation lifecycleOperation = Mockito.mock(IInterfaceLifecycleOperation.class); - public static final IUserAdminOperation userOperation = Mockito.mock(IUserAdminOperation.class); - public static final IElementOperation elementOperation = Mockito.mock(IElementOperation.class); - public static final ArtifactCassandraDao artifactCassandraDao = Mockito.mock(ArtifactCassandraDao.class); - public static final ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class); + private static ArtifactsBusinessLogic artifactBL; + @Mock + private ArtifactOperation artifactOperation; + @Mock + public ComponentsUtils componentsUtils; + @Mock + private IInterfaceLifecycleOperation lifecycleOperation; + @Mock + private IUserAdminOperation userOperation; + @Mock + private IElementOperation elementOperation; + @Mock + private ArtifactCassandraDao artifactCassandraDao; + @Mock + public ToscaOperationFacade toscaOperationFacade; + @Mock + private UserBusinessLogic userBusinessLogic; + @Mock + private NodeTemplateOperation nodeTemplateOperation; + @Mock + private ArtifactsOperations artifactsOperations; // public static final InformationDeployedArtifactsBusinessLogic // informationDeployedArtifactsBusinessLogic = @@ -96,31 +126,6 @@ public class ArtifactBusinessLogicTest { public static final Resource resource = Mockito.mock(Resource.class); private Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @BeforeClass - public static void setup() { - - Either NotFoundResult = Either.right(StorageOperationStatus.NOT_FOUND); -// when(artifactOperation.getArtifactById(Mockito.anyString(), Mockito.anyBoolean())).thenReturn(NotFoundResult); - - Either, StorageOperationStatus> NotFoundResult2 = Either.right(StorageOperationStatus.NOT_FOUND); - when(artifactOperation.getArtifacts(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Service), Mockito.anyBoolean())).thenReturn(NotFoundResult2); - when(artifactOperation.getArtifacts(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource), Mockito.anyBoolean())).thenReturn(NotFoundResult2); - - Either, StorageOperationStatus> notFoundInterfaces = Either.right(StorageOperationStatus.NOT_FOUND); - when(lifecycleOperation.getAllInterfacesOfResource(Mockito.anyString(), Mockito.anyBoolean())).thenReturn(notFoundInterfaces); - - User userJH = new User("John", "Doh", "jh0003", "jh0003@gmail.com", "ADMIN", System.currentTimeMillis()); - Either getUserResult = Either.left(userJH); - - when(userOperation.getUserData("jh0003", false)).thenReturn(getUserResult); - - Either, ActionStatus> getType = Either.left(getAllTypes()); - when(elementOperation.getAllArtifactTypes()).thenReturn(getType); - - when(resource.getResourceType()).thenReturn(ResourceTypeEnum.VFC); - // when(informationDeployedArtifactsBusinessLogic.getAllDeployableArtifacts(Mockito.any(Resource.class))).thenReturn(new - // ArrayList()); - } private static List getAllTypes() { List artifactTypes = new ArrayList(); @@ -136,6 +141,23 @@ public class ArtifactBusinessLogicTest { @Before public void initMocks() { MockitoAnnotations.initMocks(this); + Either NotFoundResult = Either.right(StorageOperationStatus.NOT_FOUND); + + Either, StorageOperationStatus> NotFoundResult2 = Either.right(StorageOperationStatus.NOT_FOUND); + when(artifactOperation.getArtifacts(Mockito.anyString(), eq(NodeTypeEnum.Service), Mockito.anyBoolean())).thenReturn(NotFoundResult2); + when(artifactOperation.getArtifacts(Mockito.anyString(), eq(NodeTypeEnum.Resource), Mockito.anyBoolean())).thenReturn(NotFoundResult2); + + Either, StorageOperationStatus> notFoundInterfaces = Either.right(StorageOperationStatus.NOT_FOUND); + when(lifecycleOperation.getAllInterfacesOfResource(Mockito.anyString(), Mockito.anyBoolean())).thenReturn(notFoundInterfaces); + + Either getUserResult = Either.left(USER); + + when(userOperation.getUserData("jh0003", false)).thenReturn(getUserResult); + + Either, ActionStatus> getType = Either.left(getAllTypes()); + when(elementOperation.getAllArtifactTypes()).thenReturn(getType); + + when(resource.getResourceType()).thenReturn(ResourceTypeEnum.VFC); } @Test @@ -283,9 +305,59 @@ public class ArtifactBusinessLogicTest { assertTrue(downloadServiceArtifactByNamesRes.isLeft()); assertTrue(downloadServiceArtifactByNamesRes.left().value() !=null && downloadServiceArtifactByNamesRes.left().value().length == payload.length); } - - // @Test + @Test + public void createHeatEnvPlaceHolder_vf_emptyHeatParameters() throws Exception { + ArtifactDefinition heatArtifact = new ArtifactBuilder() + .addHeatParam(ObjectGenerator.buildHeatParam("defVal1", "val1")) + .addHeatParam(ObjectGenerator.buildHeatParam("defVal2", "val2")) + .build(); + + Resource component = new Resource(); + when(userBusinessLogic.getUser(anyString(), anyBoolean())).thenReturn(Either.left(USER)); + when(artifactsOperations.addHeatEnvArtifact(any(ArtifactDefinition.class), any(ArtifactDefinition.class), eq(component.getUniqueId()), eq(NodeTypeEnum.Resource), eq(true), eq("parentId"))) + .thenReturn(Either.left(new ArtifactDefinition())); + Either heatEnvPlaceHolder = artifactBL.createHeatEnvPlaceHolder(heatArtifact, HEAT_VF_ENV_NAME, "parentId", NodeTypeEnum.Resource, "parentName", USER, component, Collections.emptyMap()); + assertTrue(heatEnvPlaceHolder.isLeft()); + assertNull(heatEnvPlaceHolder.left().value().getListHeatParameters()); + } + + @Test + public void createHeatEnvPlaceHolder_resourceInstance_copyHeatParamasCurrValuesToHeatEnvDefaultVal() throws Exception { + HeatParameterDefinition heatParam1 = ObjectGenerator.buildHeatParam("defVal1", "val1"); + HeatParameterDefinition heatParam2 = ObjectGenerator.buildHeatParam("defVal2", "val2"); + HeatParameterDefinition heatParam3 = ObjectGenerator.buildHeatParam("defVal3", "val3"); + ArtifactDefinition heatArtifact = new ArtifactBuilder() + .addHeatParam(heatParam1) + .addHeatParam(heatParam2) + .addHeatParam(heatParam3) + .build(); + + Resource component = new Resource(); + + when(userBusinessLogic.getUser(anyString(), anyBoolean())).thenReturn(Either.left(USER)); + when(artifactsOperations.addHeatEnvArtifact(any(ArtifactDefinition.class), any(ArtifactDefinition.class), eq(component.getUniqueId()), eq(NodeTypeEnum.Resource), eq(true), eq("parentId"))) + .thenReturn(Either.left(new ArtifactDefinition())); + + Either heatEnvPlaceHolder = artifactBL.createHeatEnvPlaceHolder(heatArtifact, HEAT_ENV_NAME, "parentId", NodeTypeEnum.ResourceInstance, "parentName", USER, component, Collections.emptyMap()); + + assertTrue(heatEnvPlaceHolder.isLeft()); + ArtifactDefinition heatEnvArtifact = heatEnvPlaceHolder.left().value(); + List listHeatParameters = heatEnvArtifact.getListHeatParameters(); + assertEquals(listHeatParameters.size(), 3); + verifyHeatParam(listHeatParameters.get(0), heatParam1); + verifyHeatParam(listHeatParameters.get(1), heatParam2); + verifyHeatParam(listHeatParameters.get(2), heatParam3); + } + + private void verifyHeatParam(HeatParameterDefinition heatEnvParam, HeatParameterDefinition heatYamlParam) { + assertEquals(heatEnvParam.getDefaultValue(), heatYamlParam.getCurrentValue()); + assertNull(heatEnvParam.getCurrentValue()); + } + + + +// @Test // public void convertAndValidateDeploymentArtifactNonHeatSuccess(){ // ArtifactDefinition createArtifactDef = createArtifactDef(); // createArtifactDef.setArtifactType(ArtifactTypeEnum.YANG_XML.getType()); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactResolverTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactResolverTest.java index a325817316..8ad9bf80b2 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactResolverTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ArtifactResolverTest.java @@ -20,6 +20,12 @@ package org.openecomp.sdc.be.components.impl; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.util.Collections; +import java.util.Map; + import org.junit.Before; import org.junit.Test; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; @@ -28,12 +34,6 @@ import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; -import java.util.Collections; -import java.util.Map; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - public class ArtifactResolverTest { private ArtifactResolverImpl testInstance = new ArtifactResolverImpl(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogicTest.java index e10c3b41ba..630f41f905 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/AttributeBusinessLogicTest.java @@ -2,9 +2,6 @@ package org.openecomp.sdc.be.components.impl; import java.util.List; -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.exception.ResponseFormat; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManagerTest.java index 776fe8864e..41835a6cdc 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CapabilityTypeImportManagerTest.java @@ -39,8 +39,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.openecomp.sdc.be.components.impl.CapabilityTypeImportManager; -import org.openecomp.sdc.be.components.impl.CommonImportManager; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.CapabilityTypeDefinition; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java index 05fc6a2948..2c83c60fc6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java @@ -38,8 +38,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.openecomp.sdc.be.components.impl.CategoriesImportManager; -import org.openecomp.sdc.be.components.impl.InterfaceLifecycleTypeImportManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -68,13 +66,12 @@ public class CategoriesImportManagerTest { subcategory = new SubCategoryDefinition(); subcategory.setUniqueId("123"); - when(elementOperation.createCategory(Mockito.any(CategoryDefinition.class), Mockito.any(NodeTypeEnum.class))).thenAnswer(new Answer>() { - public Either answer(InvocationOnMock invocation) { - Object[] args = invocation.getArguments(); - Either ans = Either.left((CategoryDefinition) args[0]); - return ans; - } - + when(elementOperation.createCategory(Mockito.any(CategoryDefinition.class), Mockito.any(NodeTypeEnum.class))).thenAnswer((Answer>) invocation -> { + Object[] args = invocation.getArguments(); + CategoryDefinition category = (CategoryDefinition) args[0]; + category.setUniqueId("123"); + Either ans = Either.left(category); + return ans; }); when(elementOperation.createSubCategory(Mockito.any(String.class), Mockito.any(SubCategoryDefinition.class), Mockito.any(NodeTypeEnum.class))).thenAnswer(new Answer>() { public Either answer(InvocationOnMock invocation) { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java new file mode 100644 index 0000000000..65f7ac46b6 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java @@ -0,0 +1,245 @@ +package org.openecomp.sdc.be.components.impl; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiPredicate; + +import org.assertj.core.util.Lists; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.impl.ServletUtils; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.RelationshipImpl; +import org.openecomp.sdc.be.model.RelationshipInfo; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.user.UserBusinessLogic; +import org.openecomp.sdc.exception.ResponseFormat; + +import fj.data.Either; + +/** + * The test suite designed for test functionality of ComponentInstanceBusinessLogic class + */ +public class ComponentInstanceBusinessLogicTest { + + private final static String USER_ID = "jh0003"; + private final static String COMPONENT_ID = "componentId"; + private final static String TO_INSTANCE_ID = "toInstanceId"; + private final static String FROM_INSTANCE_ID = "fromInstanceId"; + private final static String RELATION_ID = "relationId"; + private final static String CAPABILITY_OWNER_ID = "capabilityOwnerId"; + private final static String CAPABILITY_UID = "capabilityUid"; + private final static String CAPABILITY_NAME = "capabilityName"; + private final static String REQUIREMENT_OWNER_ID = "requirementOwnerId"; + private final static String REQUIREMENT_UID = "requirementUid"; + private final static String REQUIREMENT_NAME = "requirementName"; + private final static String RELATIONSHIP_TYPE = "relationshipType"; + + private static ComponentsUtils componentsUtils; + private static ServletUtils servletUtils; + private static ResponseFormat responseFormat; + private static ToscaOperationFacade toscaOperationFacade; + private static UserBusinessLogic userAdmin; + + private static ComponentInstanceBusinessLogic serviceBusinessLogic; + private static ComponentInstanceBusinessLogic resourceBusinessLogic; + private static User user; + private static Component service; + private static Component resource; + private static ComponentInstance toInstance; + private static ComponentInstance fromInstance; + private static CapabilityDataDefinition capability; + private static RequirementDataDefinition requirement; + private static RequirementCapabilityRelDef relation; + + @BeforeClass + public static void setup() { + createMocks(); + setMocks(); + stubMethods(); + createComponents(); + } + + @Test + public void testGetRelationByIdSuccess(){ + getServiceRelationByIdSuccess(service); + getServiceRelationByIdSuccess(resource); + } + + @Test + public void testGetRelationByIdUserValidationFailure(){ + getServiceRelationByIdUserValidationFailure(service); + getServiceRelationByIdUserValidationFailure(resource); + } + + @Test + public void testGetRelationByIdComponentNotFoundFailure(){ + getRelationByIdComponentNotFoundFailure(service); + getRelationByIdComponentNotFoundFailure(resource); + } + + @SuppressWarnings("unchecked") + private void getServiceRelationByIdSuccess(Component component){ + Either eitherCreator = Either.left(user); + when(userAdmin.getUser(eq(USER_ID), eq(false))).thenReturn(eitherCreator); + Either getComponentRes = Either.left(component); + when(toscaOperationFacade.getToscaElement(eq(COMPONENT_ID), any(ComponentParametersView.class))).thenReturn(getComponentRes); + + Either getfulfilledRequirementRes = Either.left(requirement); + when(toscaOperationFacade.getFulfilledRequirementByRelation(eq(COMPONENT_ID), eq(FROM_INSTANCE_ID), eq(relation), any(BiPredicate.class))).thenReturn(getfulfilledRequirementRes); + + Either getfulfilledCapabilityRes = Either.left(capability); + when(toscaOperationFacade.getFulfilledCapabilityByRelation(eq(COMPONENT_ID), eq(FROM_INSTANCE_ID), eq(relation), any(BiPredicate.class))).thenReturn(getfulfilledCapabilityRes); + + Either response = serviceBusinessLogic.getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType()); + assertTrue(response.isLeft()); + } + + private void getServiceRelationByIdUserValidationFailure(Component component){ + Either eitherCreator = Either.right(ActionStatus.USER_NOT_FOUND); + when(userAdmin.getUser(eq(USER_ID), eq(false))).thenReturn(eitherCreator); + + Either response = serviceBusinessLogic.getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType()); + assertTrue(response.isRight()); + } + + private void getRelationByIdComponentNotFoundFailure(Component component){ + Either eitherCreator = Either.left(user); + when(userAdmin.getUser(eq(USER_ID), eq(false))).thenReturn(eitherCreator); + Either getComponentRes = Either.right(StorageOperationStatus.NOT_FOUND); + when(toscaOperationFacade.getToscaElement(eq(COMPONENT_ID), any(ComponentParametersView.class))).thenReturn(getComponentRes); + + Either response = serviceBusinessLogic.getRelationById(COMPONENT_ID, RELATION_ID, USER_ID, component.getComponentType()); + assertTrue(response.isRight()); + } + + private static void createMocks() { + componentsUtils = Mockito.mock(ComponentsUtils.class); + servletUtils = Mockito.mock(ServletUtils.class); + responseFormat = Mockito.mock(ResponseFormat.class); + toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class); + userAdmin = Mockito.mock(UserBusinessLogic.class); + user = Mockito.mock(User.class); + } + + private static void setMocks() { + serviceBusinessLogic = new ServiceComponentInstanceBusinessLogic(); + serviceBusinessLogic.setToscaOperationFacade(toscaOperationFacade); + serviceBusinessLogic.setUserAdmin(userAdmin); + serviceBusinessLogic.setComponentsUtils(componentsUtils); + + resourceBusinessLogic = new VFComponentInstanceBusinessLogic(); + resourceBusinessLogic.setToscaOperationFacade(toscaOperationFacade); + resourceBusinessLogic.setUserAdmin(userAdmin); + resourceBusinessLogic.setComponentsUtils(componentsUtils); + } + + private static void stubMethods() { + when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils); + when(componentsUtils.getResponseFormat(eq(ActionStatus.RELATION_NOT_FOUND), eq(RELATION_ID), eq(COMPONENT_ID))).thenReturn(responseFormat); + } + + private static void createComponents() { + createRelation(); + createInstances(); + createService(); + createResource(); + } + + private static void createResource() { + resource = new Resource(); + resource.setUniqueId(COMPONENT_ID); + resource.setComponentInstancesRelations(Lists.newArrayList(relation)); + resource.setComponentInstances(Lists.newArrayList(toInstance,fromInstance)); + resource.setCapabilities(toInstance.getCapabilities()); + resource.setRequirements(fromInstance.getRequirements()); + resource.setComponentType(ComponentTypeEnum.RESOURCE); + } + + + private static void createService() { + service = new Service(); + service.setUniqueId(COMPONENT_ID); + service.setComponentInstancesRelations(Lists.newArrayList(relation)); + service.setComponentInstances(Lists.newArrayList(toInstance,fromInstance)); + service.setCapabilities(toInstance.getCapabilities()); + service.setRequirements(fromInstance.getRequirements()); + service.setComponentType(ComponentTypeEnum.SERVICE); + } + + + private static void createInstances() { + toInstance = new ComponentInstance(); + toInstance.setUniqueId(TO_INSTANCE_ID); + + fromInstance = new ComponentInstance(); + fromInstance.setUniqueId(FROM_INSTANCE_ID); + + capability = new CapabilityDataDefinition(); + capability.setOwnerId(CAPABILITY_OWNER_ID); + capability.setUniqueId(CAPABILITY_UID); + capability.setName(CAPABILITY_NAME); + + Map> capabilities = new HashMap<>(); + capabilities.put(capability.getName(), Lists.newArrayList(new CapabilityDefinition(capability))); + + requirement = new RequirementDataDefinition(); + requirement.setOwnerId(REQUIREMENT_OWNER_ID); + requirement.setUniqueId(REQUIREMENT_UID); + requirement.setName(REQUIREMENT_NAME); + requirement.setRelationship(RELATIONSHIP_TYPE); + + + Map> requirements = new HashMap<>(); + requirements.put(requirement.getCapability(), Lists.newArrayList(new RequirementDefinition(requirement))); + + toInstance.setCapabilities(capabilities); + fromInstance.setRequirements(requirements); + } + + + private static void createRelation() { + + relation = new RequirementCapabilityRelDef(); + CapabilityRequirementRelationship relationship = new CapabilityRequirementRelationship(); + RelationshipInfo relationInfo = new RelationshipInfo(); + relationInfo.setId(RELATION_ID); + relationship.setRelation(relationInfo); + + relation.setRelationships(Lists.newArrayList(relationship)); + relation.setToNode(TO_INSTANCE_ID); + relation.setFromNode(FROM_INSTANCE_ID); + + relationInfo.setCapabilityOwnerId(CAPABILITY_OWNER_ID); + relationInfo.setCapabilityUid(CAPABILITY_UID); + relationInfo.setCapability(CAPABILITY_NAME); + relationInfo.setRequirementOwnerId(REQUIREMENT_OWNER_ID); + relationInfo.setRequirementUid(REQUIREMENT_UID); + relationInfo.setRequirement(REQUIREMENT_NAME); + RelationshipImpl relationshipImpl = new RelationshipImpl(); + relationshipImpl.setType(RELATIONSHIP_TYPE); + relationInfo.setRelationships(relationshipImpl); + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogicTest.java index 135caf2c82..4f1f929382 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CompositionBusinessLogicTest.java @@ -31,7 +31,6 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.CompositionBusinessLogic; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ConsumerBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ConsumerBusinessLogicTest.java index 259d47befa..db95ee8827 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ConsumerBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ConsumerBusinessLogicTest.java @@ -1,12 +1,8 @@ package org.openecomp.sdc.be.components.impl; -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.model.ConsumerDefinition; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.exception.ResponseFormat; import fj.data.Either; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CsarValidationUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CsarValidationUtilsTest.java index 84c8286f14..50ad990560 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CsarValidationUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CsarValidationUtilsTest.java @@ -21,9 +21,9 @@ package org.openecomp.sdc.be.components.impl; import java.util.Arrays; + import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.CsarValidationUtils; public class CsarValidationUtilsTest { private String[] invalidExtensions = { null, ".bla", ".yaml", ".yml", ".txt", ".zip" }; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java index 7722c1fdea..bcde49295e 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogicTest.java @@ -2,48 +2,23 @@ package org.openecomp.sdc.be.components.impl; import java.util.List; import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.annotation.Generated; - -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.structure.T; -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; -import org.openecomp.sdc.be.datamodel.api.CategoryTypeEnum; -import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactType; import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.DistributionStatusEnum; -import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.PropertyScope; -import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.GroupingDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.resources.data.ComponentMetadataData; -import org.openecomp.sdc.be.resources.data.ResourceMetadataData; -import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; -import org.openecomp.sdc.be.resources.data.category.SubCategoryData; import org.openecomp.sdc.be.ui.model.UiCategories; import org.openecomp.sdc.exception.ResponseFormat; -import com.google.common.util.concurrent.Service; -import com.thinkaurelius.titan.core.TitanGraph; - import fj.data.Either; -import io.swagger.annotations.Tag; public class ElementBusinessLogicTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogicTest.java index df2d2e7fdc..d9ca7b06c2 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/GroupBusinessLogicTest.java @@ -4,8 +4,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ImportUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ImportUtilsTest.java index 59d49de3a3..5edf448cc2 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ImportUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ImportUtilsTest.java @@ -22,8 +22,9 @@ package org.openecomp.sdc.be.components.impl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files; @@ -33,10 +34,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.function.Function; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.ImportUtils; import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum; import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaElementTypeEnum; import org.openecomp.sdc.be.components.impl.ImportUtils.ToscaTagNamesEnum; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java index db5531debf..ac4d37ef76 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java @@ -20,7 +20,15 @@ package org.openecomp.sdc.be.components.impl; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -35,18 +43,10 @@ import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; -import org.openecomp.sdc.be.model.operations.impl.PropertyOperation; import org.openecomp.sdc.be.user.IUserBusinessLogic; import org.openecomp.sdc.exception.ResponseFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import fj.data.Either; public class InputsBusinessLogicTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManagerTest.java index 6ba74ec133..8109e36be1 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceLifecycleTypeImportManagerTest.java @@ -37,8 +37,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.openecomp.sdc.be.components.impl.CommonImportManager; -import org.openecomp.sdc.be.components.impl.InterfaceLifecycleTypeImportManager; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.InterfaceDefinition; import org.openecomp.sdc.be.model.operations.api.IInterfaceLifecycleOperation; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ProductBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ProductBusinessLogicTest.java index 222bba53d2..cbb5f7b719 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ProductBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ProductBusinessLogicTest.java @@ -3,10 +3,7 @@ package org.openecomp.sdc.be.components.impl; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.math3.stat.descriptive.summary.Product; -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.Component; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java index 0e27636901..f7724aaeff 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java @@ -32,14 +32,11 @@ import java.util.EnumMap; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.regex.Pattern; import java.util.stream.Collectors; import javax.servlet.ServletContext; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -51,55 +48,31 @@ import org.openecomp.sdc.be.auditing.api.IAuditingManager; import org.openecomp.sdc.be.auditing.impl.AuditingLogFormatUtil; import org.openecomp.sdc.be.auditing.impl.AuditingManager; import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum; -import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationInfo; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; -import org.openecomp.sdc.be.datamodel.api.HighestFilterEnum; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.WebAppContextWrapper; -import org.openecomp.sdc.be.info.ArtifactTemplateInfo; -import org.openecomp.sdc.be.info.MergedArtifactInfo; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.ComponentInstanceInput; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.CsarInfo; import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.GroupDefinition; -import org.openecomp.sdc.be.model.GroupProperty; -import org.openecomp.sdc.be.model.GroupTypeDefinition; -import org.openecomp.sdc.be.model.HeatParameterDefinition; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; -import org.openecomp.sdc.be.model.NodeTypeInfo; -import org.openecomp.sdc.be.model.ParsedToscaYamlInfo; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; -import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.UploadCapInfo; -import org.openecomp.sdc.be.model.UploadComponentInstanceInfo; -import org.openecomp.sdc.be.model.UploadPropInfo; -import org.openecomp.sdc.be.model.UploadReqInfo; -import org.openecomp.sdc.be.model.UploadResourceInfo; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; -import org.openecomp.sdc.be.model.category.CategoryDefinition; -import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.NodeTypeOperation; import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; -import org.openecomp.sdc.be.model.operations.api.ICacheMangerOperation; import org.openecomp.sdc.be.model.operations.api.ICapabilityTypeOperation; import org.openecomp.sdc.be.model.operations.api.IElementOperation; import org.openecomp.sdc.be.model.operations.api.IPropertyOperation; @@ -110,15 +83,12 @@ import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.tosca.CsarUtils.NonMetaArtifactInfo; -import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; -import org.openecomp.sdc.be.user.IUserBusinessLogic; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.common.util.GeneralUtility; @@ -128,10 +98,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; -import com.att.nsa.cambria.test.support.CambriaBatchingPublisherMock.Entry; -import com.google.common.base.Equivalence.Wrapper; -import com.netflix.astyanax.connectionpool.Operation; - import fj.data.Either; public class ResourceBusinessLogicTest { @@ -145,10 +111,10 @@ public class ResourceBusinessLogicTest { public static final String UPDATED_SUBCATEGORY = "Gateway"; public static final String RESOURCE_NAME = "My-Resource_Name with space"; - private static final String GENERIC_VF_NAME = "org.openecomp.resource.abstract.nodes.VF"; - private static final String GENERIC_VFC_NAME = "org.openecomp.resource.abstract.nodes.VFC"; - private static final String GENERIC_PNF_NAME = "org.openecomp.resource.abstract.nodes.PNF"; - + private static final String GENERIC_VF_NAME = "org.openecomp.resource.abstract.nodes.VF"; + private static final String GENERIC_VFC_NAME = "org.openecomp.resource.abstract.nodes.VFC"; + private static final String GENERIC_PNF_NAME = "org.openecomp.resource.abstract.nodes.PNF"; + final ServletContext servletContext = Mockito.mock(ServletContext.class); IAuditingManager iAuditingManager = null; IElementOperation mockElementDao; @@ -179,9 +145,10 @@ public class ResourceBusinessLogicTest { ArtifactsBusinessLogic artifactManager = new ArtifactsBusinessLogic(); CsarOperation csarOperation = Mockito.mock(CsarOperation.class); Map emptyDataTypes = new HashMap(); - + private GenericTypeBusinessLogic genericTypeBusinessLogic = Mockito.mock(GenericTypeBusinessLogic.class); CacheMangerOperation cacheManager = Mockito.mock(CacheMangerOperation.class); + public ResourceBusinessLogicTest() { } @@ -195,8 +162,7 @@ public class ResourceBusinessLogicTest { // Init Configuration String appConfigDir = "src/test/resources/config/catalog-be"; - ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), - appConfigDir); + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); // Elements @@ -214,38 +180,30 @@ public class ResourceBusinessLogicTest { // Servlet Context attributes when(servletContext.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)).thenReturn(configurationManager); - when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)) - .thenReturn(webAppContextWrapper); + when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)).thenReturn(webAppContextWrapper); when(webAppContextWrapper.getWebAppContext(servletContext)).thenReturn(webAppContext); when(webAppContext.getBean(IElementOperation.class)).thenReturn(mockElementDao); Either eitherCountRoot = Either.left(1); Either eitherFalse = Either.left(true); - when(toscaOperationFacade.validateComponentNameExists("Root", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)) - .thenReturn(eitherFalse); + when(toscaOperationFacade.validateComponentNameExists("Root", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherFalse); Either eitherCountExist = Either.left(true); - when(toscaOperationFacade.validateComponentNameExists("alreadyExists", ResourceTypeEnum.VFC, - ComponentTypeEnum.RESOURCE)).thenReturn(eitherCountExist); - + when(toscaOperationFacade.validateComponentNameExists("alreadyExists", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCountExist); + Either eitherCount = Either.left(false); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VFC, - ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VF, - ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.PNF, - ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VF, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.PNF, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + Either validateDerivedExists = Either.left(true); when(toscaOperationFacade.validateToscaResourceNameExists("Root")).thenReturn(validateDerivedExists); - + Either validateDerivedNotExists = Either.left(false); when(toscaOperationFacade.validateToscaResourceNameExists("kuku")).thenReturn(validateDerivedNotExists); - when(graphLockOperation.lockComponent(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))) - .thenReturn(StorageOperationStatus.OK); - when(graphLockOperation.lockComponentByName(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))) - .thenReturn(StorageOperationStatus.OK); - + when(graphLockOperation.lockComponent(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))).thenReturn(StorageOperationStatus.OK); + when(graphLockOperation.lockComponentByName(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))).thenReturn(StorageOperationStatus.OK); + // createResource resourceResponse = createResourceObject(true); Either eitherCreate = Either.left(resourceResponse); @@ -272,6 +230,7 @@ public class ResourceBusinessLogicTest { bl.setApplicationDataTypeCache(applicationDataTypeCache); bl.setCsarOperation(csarOperation); bl.setCacheManagerOperation(cacheManager); + bl.setGenericTypeBusinessLogic(genericTypeBusinessLogic); toscaOperationFacade.setNodeTypeOperation(nodeTypeOperation); toscaOperationFacade.setTopologyTemplateOperation(topologyTemplateOperation); bl.setToscaOperationFacade(toscaOperationFacade); @@ -334,7 +293,7 @@ public class ResourceBusinessLogicTest { if (afterCreate) { resource.setName(resource.getName()); resource.setVersion("0.1"); - + resource.setUniqueId(resource.getName().toLowerCase() + ":" + resource.getVersion()); resource.setCreatorUserId(user.getUserId()); resource.setCreatorFullName(user.getFirstName() + " " + user.getLastName()); @@ -352,8 +311,7 @@ public class ResourceBusinessLogicTest { @Test public void testHappyScenario() { Resource resource = createResourceObject(false); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); if (createResponse.isRight()) { assertEquals(new Integer(200), createResponse.right().value().getStatus()); @@ -365,17 +323,15 @@ public class ResourceBusinessLogicTest { public void testUpdateHappyScenario() { Resource resource = createResourceObjectCsar(true); setCanWorkOnResource(resource); - + Either resourceLinkedToCsarRes = Either.left(resource); - when(toscaOperationFacade.getLatestComponentByCsarOrName(ComponentTypeEnum.RESOURCE, resource.getCsarUUID(), - resource.getSystemName())).thenReturn(resourceLinkedToCsarRes); + when(toscaOperationFacade.getLatestComponentByCsarOrName(ComponentTypeEnum.RESOURCE, resource.getCsarUUID(), resource.getSystemName())).thenReturn(resourceLinkedToCsarRes); Either validateDerivedExists = Either.left(true); when(toscaOperationFacade.validateToscaResourceNameExists("Root")).thenReturn(validateDerivedExists); - + Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either updateResponse = bl.validateAndUpdateResourceFromCsar(resource, user, null, - null, resource.getUniqueId()); + Either updateResponse = bl.validateAndUpdateResourceFromCsar(resource, user, null, null, resource.getUniqueId()); if (updateResponse.isRight()) { assertEquals(new Integer(200), updateResponse.right().value().getStatus()); } @@ -403,7 +359,7 @@ public class ResourceBusinessLogicTest { testTagsExceedsLimitCreate(); testTagsNoServiceName(); testInvalidTag(); - + testContactIdTooLong(); testContactIdWrongFormatCreate(); testResourceContactIdEmpty(); @@ -431,18 +387,15 @@ public class ResourceBusinessLogicTest { resourceExist.setName(resourceName); resourceExist.getTags().add(resourceName); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), - resourceName); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), resourceName); } private void testResourceNameEmpty() { Resource resourceExist = createResourceObject(false); resourceExist.setName(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertResponse(createResponse, ActionStatus.MISSING_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); } @@ -452,11 +405,9 @@ public class ResourceBusinessLogicTest { String tooLongResourceName = "zCRCAWjqte0DtgcAAMmcJcXeNubeX1p1vOZNTShAHOYNAHvV3iK"; resourceExccedsNameLimit.setName(tooLongResourceName); - Either createResponse = bl.createResource(resourceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), - "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); } private void testResourceNameWrongFormat() { @@ -465,8 +416,7 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "ljg?fd"; resource.setName(nameWrongFormat); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); } @@ -487,11 +437,9 @@ public class ResourceBusinessLogicTest { resourceExccedsDescLimit.setDescription(tooLongResourceDesc); - Either createResponse = bl.createResource(resourceExccedsDescLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsDescLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, - ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); } private void testResourceDescNotEnglish() { @@ -500,35 +448,29 @@ public class ResourceBusinessLogicTest { String notEnglishDesc = "\uC2B5"; notEnglish.setDescription(notEnglishDesc); - Either createResponse = bl.createResource(notEnglish, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(notEnglish, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_DESCRIPTION, - ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); } private void testResourceDescriptionEmpty() { Resource resourceExist = createResourceObject(false); resourceExist.setDescription(""); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, - ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); } private void testResourceDescriptionMissing() { Resource resourceExist = createResourceObject(false); resourceExist.setDescription(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, - ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); } // Resource description - end // Resource icon start @@ -537,8 +479,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -548,8 +489,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon("kjk3453^&"); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -559,12 +499,10 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon("dsjfhskdfhskjdhfskjdhkjdhfkshdfksjsdkfhsdfsdfsdfsfsdfsf"); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), - "" + ValidationUtils.ICON_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.ICON_MAX_LENGTH); } // Resource icon end @@ -573,8 +511,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setTags(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_TAGS); @@ -584,8 +521,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setTags(new ArrayList()); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_TAGS); @@ -641,11 +577,9 @@ public class ResourceBusinessLogicTest { resourceExccedsNameLimit.setTags(tagsList); - Either createResponse = bl.createResource(resourceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, - "" + ValidationUtils.TAG_LIST_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, "" + ValidationUtils.TAG_LIST_MAX_LENGTH); } @@ -659,11 +593,9 @@ public class ResourceBusinessLogicTest { resourceExccedsNameLimit.setTags(tagsList); - Either createResponse = bl.createResource(resourceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT, - "" + ValidationUtils.TAG_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT, "" + ValidationUtils.TAG_MAX_LENGTH); } @@ -674,8 +606,7 @@ public class ResourceBusinessLogicTest { tagsList.add(tag1); serviceExccedsNameLimit.setTags(tagsList); - Either createResponse = bl.createResource(serviceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(serviceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME); @@ -688,8 +619,7 @@ public class ResourceBusinessLogicTest { tagsList.add(tag1); serviceExccedsNameLimit.setTags(tagsList); - Either createResponse = bl.createResource(serviceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(serviceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_FIELD_FORMAT, new String[] { "Resource", "tag" }); @@ -697,15 +627,14 @@ public class ResourceBusinessLogicTest { // Resource tags - stop // Resource contact start - + private void testContactIdTooLong() { Resource resourceContactId = createResourceObject(false); // 59 chars instead of 50 String contactIdTooLong = "thisNameIsVeryLongAndExeccedsTheNormalLengthForContactId"; resourceContactId.setContactId(contactIdTooLong); - Either createResponse = bl.createResource(resourceContactId, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceContactId, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); } @@ -716,8 +645,7 @@ public class ResourceBusinessLogicTest { String contactIdFormatWrong = "yrt134!!!"; resourceContactId.setContactId(contactIdFormatWrong); - Either createResponse = bl.createResource(resourceContactId, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceContactId, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); } @@ -726,8 +654,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setContactId(""); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -737,8 +664,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setContactId(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -749,23 +675,19 @@ public class ResourceBusinessLogicTest { String tooLongVendorName = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsVendorNameLimit.setVendorName(tooLongVendorName); - Either createResponse = bl.createResource(resourceExccedsVendorNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsVendorNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT, - "" + ValidationUtils.VENDOR_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_NAME_MAX_LENGTH); } - + private void testResourceVendorModelNumberExceedsLimit() { Resource resourceExccedsVendorModelNumberLimit = createResourceObject(false); String tooLongVendorModelNumber = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsVendorModelNumberLimit.setResourceVendorModelNumber(tooLongVendorModelNumber); - Either createResponse = bl.createResource(resourceExccedsVendorModelNumberLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsVendorModelNumberLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_MODEL_NUMBER_EXCEEDS_LIMIT, - "" + ValidationUtils.RESOURCE_VENDOR_MODEL_NUMBER_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_MODEL_NUMBER_EXCEEDS_LIMIT, "" + ValidationUtils.RESOURCE_VENDOR_MODEL_NUMBER_MAX_LENGTH); } private void testVendorNameWrongFormatCreate() { @@ -774,8 +696,7 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "ljg*fd"; resource.setVendorName(nameWrongFormat); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_NAME); } @@ -786,8 +707,7 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "1>2"; resource.setVendorRelease(nameWrongFormat); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_RELEASE); @@ -798,19 +718,16 @@ public class ResourceBusinessLogicTest { String tooLongVendorRelease = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsNameLimit.setVendorRelease(tooLongVendorRelease); - Either createResponse = bl.createResource(resourceExccedsNameLimit, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, - "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); } private void testResourceVendorNameMissing() { Resource resourceExist = createResourceObject(false); resourceExist.setVendorName(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_VENDOR_NAME); @@ -820,8 +737,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setVendorRelease(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_VENDOR_RELEASE); @@ -833,8 +749,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setCategories(null); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -846,8 +761,7 @@ public class ResourceBusinessLogicTest { resourceExist.setCategories(null); resourceExist.addCategory("koko", "koko"); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -866,8 +780,7 @@ public class ResourceBusinessLogicTest { String licenseType = "User"; createResourceObject.setCost(cost); createResourceObject.setLicenseType(licenseType); - Either createResponse = bl.createResource(createResourceObject, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(createResourceObject, AuditingActionEnum.CREATE_RESOURCE, user, null, null); if (createResponse.isRight()) { assertEquals(new Integer(200), createResponse.right().value().getStatus()); @@ -883,8 +796,7 @@ public class ResourceBusinessLogicTest { String cost = "12356,464"; resourceCost.setCost(cost); - Either createResponse = bl.createResource(resourceCost, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceCost, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_CONTENT); } @@ -897,8 +809,7 @@ public class ResourceBusinessLogicTest { String licenseType = "cpu"; resourceLicenseType.setLicenseType(licenseType); - Either createResponse = bl.createResource(resourceLicenseType, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceLicenseType, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_CONTENT); } @@ -910,8 +821,7 @@ public class ResourceBusinessLogicTest { List list = null; resourceExist.setDerivedFrom(list); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -921,8 +831,7 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setDerivedFrom(new ArrayList()); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -934,21 +843,18 @@ public class ResourceBusinessLogicTest { derivedFrom.add("kuku"); resourceExist.setDerivedFrom(derivedFrom); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_NOT_FOUND); } // Derived from stop - private void assertResponse(Either createResponse, ActionStatus expectedStatus, - String... variables) { + private void assertResponse(Either createResponse, ActionStatus expectedStatus, String... variables) { ResponseFormat expectedResponse = responseManager.getResponseFormat(expectedStatus, variables); ResponseFormat actualResponse = createResponse.right().value(); assertEquals(expectedResponse.getStatus(), actualResponse.getStatus()); - assertEquals("assert error description", expectedResponse.getFormattedMessage(), - actualResponse.getFormattedMessage()); + assertEquals("assert error description", expectedResponse.getFormattedMessage(), actualResponse.getFormattedMessage()); } // UPDATE tests - start @@ -967,9 +873,8 @@ public class ResourceBusinessLogicTest { Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); @@ -988,12 +893,11 @@ public class ResourceBusinessLogicTest { String name = "ljg"; updatedResource.setName(name); resource.setVersion("1.0"); - + Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_NAME_CANNOT_BE_CHANGED); @@ -1014,11 +918,9 @@ public class ResourceBusinessLogicTest { Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), - "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); } @Test @@ -1034,11 +936,9 @@ public class ResourceBusinessLogicTest { updatedResource.setName(resourceName); Either dataModelResponse = Either.left(updatedResource); when(toscaOperationFacade.updateToscaElement(updatedResource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), - resourceName); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), resourceName); } // @@ -1064,11 +964,9 @@ public class ResourceBusinessLogicTest { updatedResource.setDescription(tooLongResourceDesc); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, - ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); } @@ -1087,8 +985,7 @@ public class ResourceBusinessLogicTest { Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -1111,8 +1008,7 @@ public class ResourceBusinessLogicTest { ; Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_ICON_CANNOT_BE_CHANGED); @@ -1176,12 +1072,10 @@ public class ResourceBusinessLogicTest { updatedResource.setTags(tagsList); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, - "" + ValidationUtils.TAG_LIST_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, "" + ValidationUtils.TAG_LIST_MAX_LENGTH); } @Test @@ -1198,8 +1092,7 @@ public class ResourceBusinessLogicTest { updatedResource.setVendorName(nameWrongFormat); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_NAME); @@ -1221,8 +1114,7 @@ public class ResourceBusinessLogicTest { ; Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED); @@ -1241,11 +1133,9 @@ public class ResourceBusinessLogicTest { updatedResource.setVendorRelease(tooLongVendorRelease); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), - updatedResource, null, user, false); + Either createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, - "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); } @Ignore @@ -1263,8 +1153,7 @@ public class ResourceBusinessLogicTest { updatedResource.setContactId(contactIdTooLong); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -1285,8 +1174,7 @@ public class ResourceBusinessLogicTest { updatedResource.addCategory(badCategory, "fikt"); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -1308,8 +1196,7 @@ public class ResourceBusinessLogicTest { ; Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_CATEGORY_CANNOT_BE_CHANGED); @@ -1330,8 +1217,7 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(list); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -1350,8 +1236,7 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(new ArrayList()); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -1372,8 +1257,7 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_NOT_FOUND); @@ -1388,16 +1272,13 @@ public class ResourceBusinessLogicTest { // this is in order to prevent failing with 403 earlier Either eitherUpdate = Either.left(setCanWorkOnResource(resource)); when(toscaOperationFacade.getToscaElement(resource.getUniqueId())).thenReturn(eitherUpdate); - + Either isToscaNameExtending = Either.left(true); - when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())) - .thenReturn(isToscaNameExtending); - - Either, StorageOperationStatus> findPropertiesOfNode = Either - .left(new HashMap<>()); - when(propertyOperation.deleteAllPropertiesAssociatedToNode(Mockito.any(NodeTypeEnum.class), - Mockito.anyString())).thenReturn(findPropertiesOfNode); - + when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())).thenReturn(isToscaNameExtending); + + Either, StorageOperationStatus> findPropertiesOfNode = Either.left(new HashMap<>()); + when(propertyOperation.deleteAllPropertiesAssociatedToNode(Mockito.any(NodeTypeEnum.class), Mockito.anyString())).thenReturn(findPropertiesOfNode); + resource.setVersion("1.0"); ArrayList derivedFrom = new ArrayList(); @@ -1405,11 +1286,10 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either dataModelResponse = Either.left(updatedResource); when(toscaOperationFacade.updateToscaElement(updatedResource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); assertTrue(createResponse.isLeft()); } - + @Test public void testResourceTemplateCertify_UPDATE_SAD() { Resource resource = createResourceObject(true); @@ -1419,7 +1299,7 @@ public class ResourceBusinessLogicTest { // this is in order to prevent failing with 403 earlier Either eitherUpdate = Either.left(setCanWorkOnResource(resource)); when(toscaOperationFacade.getToscaElement(resource.getUniqueId())).thenReturn(eitherUpdate); - + Either isToscaNameExtending = Either.left(false); when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())) .thenReturn(isToscaNameExtending); @@ -1431,8 +1311,8 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, - user, false); + Either createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, + false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_DOES_NOT_EXTEND); @@ -1443,28 +1323,23 @@ public class ResourceBusinessLogicTest { public void createOrUpdateResourceAlreadyCheckout() { Resource resourceExist = createResourceObject(false); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); createResponse.left().value().setLastUpdaterUserId(user.getUserId()); assertTrue(createResponse.isLeft()); - Either getLatestResult = Either.left(createResponse.left().value()); - when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getLatestResult); - when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))) - .thenReturn(getLatestResult); + Either getLatestResult = Either.left(createResponse.left().value()); + Either getCompLatestResult = Either.left(createResponse.left().value()); + when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getCompLatestResult); + when(toscaOperationFacade.overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class))).thenReturn(getLatestResult); Resource resourceToUpdtae = createResourceObject(false); - Either, ResponseFormat> createOrUpdateResource = bl - .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null, null, false); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Resource.class), - Mockito.any(Resource.class)); - Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), - Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), - Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class)); + Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1472,34 +1347,28 @@ public class ResourceBusinessLogicTest { public void createOrUpdateResourceCertified() { Resource resourceExist = createResourceObject(false); - Either createResponse = bl.createResource(resourceExist, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); Resource certifiedResource = createResponse.left().value(); certifiedResource.setLifecycleState(LifecycleStateEnum.CERTIFIED); certifiedResource.setVersion("1.0"); + - Either getLatestResult = Either.left(certifiedResource); - when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getLatestResult); - when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))) - .thenReturn(getLatestResult); + Either getLatestResult = Either.left(certifiedResource); + Either getCompLatestResult = Either.left(createResponse.left().value()); + when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getCompLatestResult); + when(toscaOperationFacade.overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class))).thenReturn(getLatestResult); - when(lifecycleBl.changeState(Mockito.anyString(), Mockito.eq(user), - Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), - Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(createResponse); + when(lifecycleBl.changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(createResponse); Resource resourceToUpdtae = createResourceObject(false); - Either, ResponseFormat> createOrUpdateResource = bl - .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null, null, false); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Component.class), - Mockito.any(Component.class)); - Mockito.verify(lifecycleBl, Mockito.times(1)).changeState(Mockito.anyString(), Mockito.eq(user), - Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), - Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class)); + Mockito.verify(lifecycleBl, Mockito.times(1)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1510,20 +1379,14 @@ public class ResourceBusinessLogicTest { Either getLatestResult = Either.right(StorageOperationStatus.NOT_FOUND); when(toscaOperationFacade.getLatestByName(resourceToUpdtae.getName())).thenReturn(getLatestResult); - Either getLatestToscaNameResult = Either - .right(StorageOperationStatus.NOT_FOUND); - when(toscaOperationFacade.getLatestByToscaResourceName(resourceToUpdtae.getToscaResourceName())) - .thenReturn(getLatestToscaNameResult); + Either getLatestToscaNameResult = Either.right(StorageOperationStatus.NOT_FOUND); + when(toscaOperationFacade.getLatestByToscaResourceName(resourceToUpdtae.getToscaResourceName())).thenReturn(getLatestToscaNameResult); - Either, ResponseFormat> createOrUpdateResource = bl - .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null, null, false); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(0)).overrideComponent(Mockito.any(Component.class), - Mockito.any(Component.class)); - Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), - Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), - Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(0)).overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class)); + Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1567,381 +1430,294 @@ public class ResourceBusinessLogicTest { assertTrue(validatePropertiesDefaultValues.isRight()); } - // @Test - // public void testDeleteMarkedResourcesNoResources() { - // List ids = new ArrayList<>(); - // Either, StorageOperationStatus> eitherNoResources = - // Either.left(ids); - // when(topologyTemplateOperation.getAllComponentsMarkedForDeletion(ComponentTypeEnum.RESOURCE)).thenReturn(eitherNoResources); - // - // Either, ResponseFormat> deleteMarkedResources = - // bl.deleteMarkedComponents(); - // assertTrue(deleteMarkedResources.isLeft()); - // assertTrue(deleteMarkedResources.left().value().isEmpty()); - // - // Mockito.verify(artifactManager, - // Mockito.times(0)).deleteAllComponentArtifactsIfNotOnGraph(Mockito.anyList()); - // - // } - // - // @Test - // public void testDeleteMarkedResources() { - // List ids = new ArrayList(); - // String resourceInUse = "123"; - // ids.add(resourceInUse); - // String resourceFree = "456"; - // ids.add(resourceFree); - // Either, StorageOperationStatus> eitherNoResources = - // Either.left(ids); - // when(toscaOperationFacade.getAllComponentsMarkedForDeletion()).thenReturn(eitherNoResources); - // - // Either resourceInUseResponse = - // Either.left(true); - // Either resourceFreeResponse = - // Either.left(false); - // - // List artifacts = new ArrayList(); - // Either, StorageOperationStatus> - // getArtifactsResponse = Either.left(artifacts); - // when(toscaOperationFacade.getComponentArtifactsForDelete(resourceFree, - // NodeTypeEnum.Resource, true)).thenReturn(getArtifactsResponse); - // - // when(toscaOperationFacade.isComponentInUse(resourceFree)).thenReturn(resourceFreeResponse); - // when(toscaOperationFacade.isComponentInUse(resourceInUse)).thenReturn(resourceInUseResponse); - // - // Either eitherDelete = Either.left(new - // Resource()); - // when(toscaOperationFacade.deleteToscaComponent(resourceFree)).thenReturn(eitherDelete); - // - // when(artifactManager.deleteAllComponentArtifactsIfNotOnGraph(artifacts)).thenReturn(StorageOperationStatus.OK); - // List deletedComponents = new ArrayList<>(); - // deletedComponents.add(resourceFree); - // when(toscaOperationFacade.deleteMarkedElements(ComponentTypeEnum.RESOURCE)).thenReturn(Either.left(deletedComponents)); - // - // Either, ResponseFormat> deleteMarkedResources = - // bl.deleteMarkedComponents(); - // assertTrue(deleteMarkedResources.isLeft()); - // List resourceIdList = deleteMarkedResources.left().value(); - // assertFalse(resourceIdList.isEmpty()); - // assertTrue(resourceIdList.contains(resourceFree)); - // assertFalse(resourceIdList.contains(resourceInUse)); - // - // Mockito.verify(artifactManager, - // Mockito.times(1)).deleteAllComponentArtifactsIfNotOnGraph(artifacts); - // } - +// @Test +// public void testDeleteMarkedResourcesNoResources() { +// List ids = new ArrayList<>(); +// Either, StorageOperationStatus> eitherNoResources = Either.left(ids); +// when(topologyTemplateOperation.getAllComponentsMarkedForDeletion(ComponentTypeEnum.RESOURCE)).thenReturn(eitherNoResources); +// +// Either, ResponseFormat> deleteMarkedResources = bl.deleteMarkedComponents(); +// assertTrue(deleteMarkedResources.isLeft()); +// assertTrue(deleteMarkedResources.left().value().isEmpty()); +// +// Mockito.verify(artifactManager, Mockito.times(0)).deleteAllComponentArtifactsIfNotOnGraph(Mockito.anyList()); +// +// } +// +// @Test +// public void testDeleteMarkedResources() { +// List ids = new ArrayList(); +// String resourceInUse = "123"; +// ids.add(resourceInUse); +// String resourceFree = "456"; +// ids.add(resourceFree); +// Either, StorageOperationStatus> eitherNoResources = Either.left(ids); +// when(toscaOperationFacade.getAllComponentsMarkedForDeletion()).thenReturn(eitherNoResources); +// +// Either resourceInUseResponse = Either.left(true); +// Either resourceFreeResponse = Either.left(false); +// +// List artifacts = new ArrayList(); +// Either, StorageOperationStatus> getArtifactsResponse = Either.left(artifacts); +// when(toscaOperationFacade.getComponentArtifactsForDelete(resourceFree, NodeTypeEnum.Resource, true)).thenReturn(getArtifactsResponse); +// +// when(toscaOperationFacade.isComponentInUse(resourceFree)).thenReturn(resourceFreeResponse); +// when(toscaOperationFacade.isComponentInUse(resourceInUse)).thenReturn(resourceInUseResponse); +// +// Either eitherDelete = Either.left(new Resource()); +// when(toscaOperationFacade.deleteToscaComponent(resourceFree)).thenReturn(eitherDelete); +// +// when(artifactManager.deleteAllComponentArtifactsIfNotOnGraph(artifacts)).thenReturn(StorageOperationStatus.OK); +// List deletedComponents = new ArrayList<>(); +// deletedComponents.add(resourceFree); +// when(toscaOperationFacade.deleteMarkedElements(ComponentTypeEnum.RESOURCE)).thenReturn(Either.left(deletedComponents)); +// +// Either, ResponseFormat> deleteMarkedResources = bl.deleteMarkedComponents(); +// assertTrue(deleteMarkedResources.isLeft()); +// List resourceIdList = deleteMarkedResources.left().value(); +// assertFalse(resourceIdList.isEmpty()); +// assertTrue(resourceIdList.contains(resourceFree)); +// assertFalse(resourceIdList.contains(resourceInUse)); +// +// Mockito.verify(artifactManager, Mockito.times(1)).deleteAllComponentArtifactsIfNotOnGraph(artifacts); +// } @SuppressWarnings("unchecked") @Test public void testFindVfCsarArtifactsToHandle() { - + Class targetClass = ResourceBusinessLogic.class; String methodName = "findVfCsarArtifactsToHandle"; Resource resource = new Resource(); String deploymentArtifactToUpdateFileName = "deploymentArtifactToUpdate.yaml"; String deploymentArtifactToDeleteFileName = "deploymentArtifactToDelete.yaml"; String deploymentArtifactToCreateFileName = "deploymentArtifactToCreate.yaml"; - + String artifactInfoToUpdateFileName = "infoArtifactToUpdate.yaml"; String artifactInfoToDeleteFileName = "infoArtifactToDelete.yaml"; String artifactInfoToCreateFileName = "infoArtifactToCreate.yaml"; - + byte[] oldPayloadData = "oldPayloadData".getBytes(); byte[] newPayloadData = "newPayloadData".getBytes(); - Map deploymentArtifacts = new HashMap<>(); - + Map deploymentArtifacts =new HashMap<>(); + ArtifactDefinition deploymentArtifactToUpdate = new ArtifactDefinition(); deploymentArtifactToUpdate.setMandatory(false); deploymentArtifactToUpdate.setArtifactName(deploymentArtifactToUpdateFileName); deploymentArtifactToUpdate.setArtifactType("SNMP_POLL"); deploymentArtifactToUpdate.setPayload(oldPayloadData); - deploymentArtifactToUpdate - .setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + deploymentArtifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); + ArtifactDefinition deploymentArtifactToDelete = new ArtifactDefinition(); deploymentArtifactToDelete.setMandatory(false); deploymentArtifactToDelete.setArtifactName(deploymentArtifactToDeleteFileName); deploymentArtifactToDelete.setArtifactType("SNMP_TRAP"); deploymentArtifactToDelete.setPayload(oldPayloadData); - deploymentArtifactToDelete - .setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + deploymentArtifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); + ArtifactDefinition deploymentArtifactToIgnore = new ArtifactDefinition(); - - deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToUpdate.getArtifactName()), - deploymentArtifactToUpdate); - deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToDelete.getArtifactName()), - deploymentArtifactToDelete); + + deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToUpdate.getArtifactName()), deploymentArtifactToUpdate); + deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToDelete.getArtifactName()), deploymentArtifactToDelete); deploymentArtifacts.put("ignore", deploymentArtifactToIgnore); - + Map artifacts = new HashMap<>(); - + ArtifactDefinition artifactToUpdate = new ArtifactDefinition(); artifactToUpdate.setMandatory(false); artifactToUpdate.setArtifactName(artifactInfoToUpdateFileName); artifactToUpdate.setArtifactType("SNMP_POLL"); artifactToUpdate.setPayload(oldPayloadData); artifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + ArtifactDefinition artifactToDelete = new ArtifactDefinition(); artifactToDelete.setMandatory(false); artifactToDelete.setArtifactName(artifactInfoToDeleteFileName); artifactToDelete.setArtifactType("SNMP_TRAP"); artifactToDelete.setPayload(oldPayloadData); artifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + ArtifactDefinition artifactToIgnore = new ArtifactDefinition(); - - artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToUpdate.getArtifactName()), artifactToUpdate); - artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToDelete.getArtifactName()), artifactToDelete); - artifacts.put("ignore", artifactToIgnore); - + + artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToUpdate.getArtifactName()),artifactToUpdate); + artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToDelete.getArtifactName()),artifactToDelete); + artifacts.put("ignore",artifactToIgnore); + resource.setDeploymentArtifacts(deploymentArtifacts); resource.setArtifacts(artifacts); - + List artifactPathAndNameList = new ArrayList<>(); - NonMetaArtifactInfo deploymentArtifactInfoToUpdate = new NonMetaArtifactInfo( - deploymentArtifactToUpdate.getArtifactName(), null, - ArtifactTypeEnum.findType(deploymentArtifactToUpdate.getArtifactType()), - ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, deploymentArtifactToUpdate.getArtifactName()); - - NonMetaArtifactInfo informationalArtifactInfoToUpdate = new NonMetaArtifactInfo( - artifactToUpdate.getArtifactName(), null, ArtifactTypeEnum.findType(artifactToUpdate.getArtifactType()), - ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, artifactToUpdate.getArtifactName()); - - NonMetaArtifactInfo deploymentArtifactInfoToCreate = new NonMetaArtifactInfo(deploymentArtifactToCreateFileName, - null, ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, - deploymentArtifactToCreateFileName); - - NonMetaArtifactInfo informationalArtifactInfoToCreate = new NonMetaArtifactInfo(artifactInfoToCreateFileName, - null, ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, - artifactInfoToCreateFileName); - + NonMetaArtifactInfo deploymentArtifactInfoToUpdate = new NonMetaArtifactInfo(deploymentArtifactToUpdate.getArtifactName(), null, + ArtifactTypeEnum.findType(deploymentArtifactToUpdate.getArtifactType()), ArtifactGroupTypeEnum.DEPLOYMENT, + newPayloadData, deploymentArtifactToUpdate.getArtifactName()); + + NonMetaArtifactInfo informationalArtifactInfoToUpdate = new NonMetaArtifactInfo(artifactToUpdate.getArtifactName(), null, + ArtifactTypeEnum.findType(artifactToUpdate.getArtifactType()), ArtifactGroupTypeEnum.DEPLOYMENT, + newPayloadData, artifactToUpdate.getArtifactName()); + + NonMetaArtifactInfo deploymentArtifactInfoToCreate = new NonMetaArtifactInfo(deploymentArtifactToCreateFileName, null, + ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, deploymentArtifactToCreateFileName); + + NonMetaArtifactInfo informationalArtifactInfoToCreate = new NonMetaArtifactInfo(artifactInfoToCreateFileName, null, + ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, + newPayloadData, artifactInfoToCreateFileName); + artifactPathAndNameList.add(deploymentArtifactInfoToUpdate); artifactPathAndNameList.add(informationalArtifactInfoToUpdate); artifactPathAndNameList.add(deploymentArtifactInfoToCreate); artifactPathAndNameList.add(informationalArtifactInfoToCreate); - - Object[] argObjects = { resource, artifactPathAndNameList, user }; - Class[] argClasses = { Resource.class, List.class, User.class }; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - Either>, ResponseFormat> findVfCsarArtifactsToHandleRes = (Either>, ResponseFormat>) method - .invoke(bl, argObjects); - assertTrue(findVfCsarArtifactsToHandleRes.isLeft()); - EnumMap> foundVfArtifacts = findVfCsarArtifactsToHandleRes - .left().value(); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size() == 2); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Update).size() == 2); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size() == 2); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @SuppressWarnings("rawtypes") - @Test - public void testBuildNestedVfcToscaNamespace() { - - Class targetClass = ResourceBusinessLogic.class; - String methodName = "buildNestedVfcToscaNamespace"; - String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - String expectedNestedVfcToscaNamespace = "org.openecomp.resource.vfc.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - Object[] argObjects = { nodeTypeFullName }; - Class[] argClasses = { String.class }; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedVfcToscaNamespace = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedVfcToscaNamespace.isEmpty()); - assertTrue(actualNestedVfcToscaNamespace.equals(expectedNestedVfcToscaNamespace)); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @SuppressWarnings("rawtypes") - @Test - public void testBuildNestedVfcToscaResourceName() { - - Class targetClass = ResourceBusinessLogic.class; - String methodName = "buildNestedVfcToscaResourceName"; - String vfResourceName = "vfname"; - String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - String expectedNestedVfcToscaResourceName = "org.openecomp.resource.vfc.vfname.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - Object[] argObjects = { vfResourceName, nodeTypeFullName }; - Class[] argClasses = { String.class, String.class }; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedVfcToscaResourceName = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedVfcToscaResourceName.isEmpty()); - assertTrue(actualNestedVfcToscaResourceName.equals(expectedNestedVfcToscaResourceName)); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @SuppressWarnings("rawtypes") - @Test - public void testBuildNestedSubstituteYamlName() { - - Class targetClass = ResourceBusinessLogic.class; - String methodName = "buildNestedSubstituteYamlName"; - String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - String expectedNestedSubstituteYamlName = "Definitions/FEAdd_On_Module_vLBAgentTemplateServiceTemplate.yaml"; - Object[] argObjects = { nodeTypeFullName }; - Class[] argClasses = { String.class }; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedSubstituteYamlName = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedSubstituteYamlName.isEmpty()); - assertTrue(actualNestedSubstituteYamlName.equals(expectedNestedSubstituteYamlName)); - - } catch (Exception e) { - e.printStackTrace(); - } + + Object[] argObjects = {resource, artifactPathAndNameList, user}; + Class[] argClasses = {Resource.class, List.class, User.class}; + try { + Method method = targetClass.getDeclaredMethod(methodName, argClasses); + method.setAccessible(true); + Either>, ResponseFormat> findVfCsarArtifactsToHandleRes = + (Either>, ResponseFormat>) method.invoke(bl, argObjects); + assertTrue(findVfCsarArtifactsToHandleRes.isLeft()); + EnumMap> foundVfArtifacts = findVfCsarArtifactsToHandleRes.left().value(); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size()==2); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Update).size()==2); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size()==2); + + } + catch (Exception e) { + e.printStackTrace(); + } } - + @Test public void testVFGeneratedInputs() { - + Resource resource = createVF(); List inputs = resource.getInputs(); assertTrue(8 == inputs.size()); - for (InputDefinition input : inputs) { + for(InputDefinition input : inputs){ assertNotNull(input.getOwnerId()); } assertTrue(resource.getDerivedFromGenericType().equals(genericVF.getToscaResourceName())); assertTrue(resource.getDerivedFromGenericVersion().equals(genericVF.getVersion())); } - + @Test public void testVFUpdateGenericInputsToLatestOnCheckout() { - - // create a VF that is derived from generic version 1.0 - Resource resource = createVF(); + + //create a VF that is derived from generic version 1.0 + Resource resource = createVF(); // create a new generic version without properties genericVF.setVersion("2.0"); genericVF.setProperties(null); String currentDerivedFromVersion = resource.getDerivedFromGenericVersion(); List currentInputs = resource.getInputs(); - // verify previous inputs ownerId fields exist - user may not delete - // generated inputs + //verify previous inputs ownerId fields exist - user may not delete generated inputs assertTrue(8 == currentInputs.stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()).size()); Either upgradeToLatestGeneric = bl.shouldUpgradeToLatestGeneric(resource); - // verify success + //verify success assertTrue(upgradeToLatestGeneric.isLeft()); - // verify update required and valid + //verify update required and valid assertTrue(upgradeToLatestGeneric.left().value()); - // verify version was upgraded + //verify version was upgraded assertFalse(resource.getDerivedFromGenericVersion().equals(currentDerivedFromVersion)); - // verify inputs were not deleted + //verify inputs were not deleted assertTrue(8 == resource.getInputs().size()); - // verify inputs ownerId fields were removed - user may delete/edit - // inputs - assertTrue(8 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()) - .size()); + //verify inputs ownerId fields were removed - user may delete/edit inputs + assertTrue(8 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()).size()); } - + + @Test public void testVFUpdateGenericInputsToLatestOnCheckoutNotPerformed() { - - // create a VF that is derived from generic version 1.0 + + //create a VF that is derived from generic version 1.0 Resource resource = createVF(); - - // add an input to the VF + + //add an input to the VF PropertyDefinition newProp = new PropertyDefinition(); newProp.setType("integer"); newProp.setName("newProp"); resource.getInputs().add(new InputDefinition(newProp)); - - // create a new generic version with a new property which has the same - // name as a user defined input on the VF with a different type + + //create a new generic version with a new property which has the same name as a user defined input on the VF with a different type genericVF.setVersion("2.0"); newProp.setType("string"); genericVF.setProperties(new ArrayList()); genericVF.getProperties().add(newProp); - + when(genericTypeBusinessLogic.fetchDerivedFromGenericType(resource)).thenReturn(Either.left(genericVF)); + when(genericTypeBusinessLogic.convertGenericTypePropertiesToInputsDefintion(genericVF.getProperties(), genericVF.getUniqueId())).thenCallRealMethod(); String currentDerivedFromVersion = resource.getDerivedFromGenericVersion(); - assertTrue(8 == resource.getInputs().stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()) - .size()); + assertTrue(8 == resource.getInputs().stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()).size()); Either upgradeToLatestGeneric = bl.shouldUpgradeToLatestGeneric(resource); - // verify success + //verify success assertTrue(upgradeToLatestGeneric.isLeft()); - // verify update is invalid an void + //verify update is invalid an void assertFalse(upgradeToLatestGeneric.left().value()); - // verify version was not upgraded + //verify version was not upgraded assertTrue(resource.getDerivedFromGenericVersion().equals(currentDerivedFromVersion)); - // verify inputs were not removed + //verify inputs were not removed assertTrue(9 == resource.getInputs().size()); - // verify user defined input exists - assertTrue(1 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()) - .size()); - assertTrue(resource.getInputs().stream().filter(p -> null == p.getOwnerId()).findAny().get().getType() - .equals("integer")); + //verify user defined input exists + assertTrue(1 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()).size()); + assertTrue(resource.getInputs().stream().filter(p -> null == p.getOwnerId()).findAny().get().getType().equals("integer")); } - + @Test public void testPNFGeneratedInputsNoGeneratedInformationalArtifacts() { - + Resource resource = createPNF(); List inputs = resource.getInputs(); assertTrue(8 == inputs.size()); - for (InputDefinition input : inputs) { + for(InputDefinition input : inputs){ assertNotNull(input.getOwnerId()); } assertTrue(resource.getDerivedFromGenericType().equals(genericPNF.getToscaResourceName())); assertTrue(resource.getDerivedFromGenericVersion().equals(genericPNF.getVersion())); assertTrue(0 == resource.getArtifacts().size()); } - + + private Resource createVF() { - + genericVF = setupGenericTypeMock(GENERIC_VF_NAME); - when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_VF_NAME)) - .thenReturn(Either.left(genericVF)); + when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_VF_NAME)).thenReturn(Either.left(genericVF)); Resource resource = createResourceObject(true); resource.setDerivedFrom(null); resource.setResourceType(ResourceTypeEnum.VF); when(toscaOperationFacade.createToscaComponent(resource)).thenReturn(Either.left(resource)); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + when(genericTypeBusinessLogic.fetchDerivedFromGenericType(resource)).thenReturn(Either.left(genericVF)); + when(genericTypeBusinessLogic.generateInputsFromGenericTypeProperties(genericVF)).thenCallRealMethod(); + when(genericTypeBusinessLogic.convertGenericTypePropertiesToInputsDefintion(genericVF.getProperties(), resource.getUniqueId())).thenCallRealMethod(); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); return createResponse.left().value(); } - - private Resource createPNF() { - + + private Resource createPNF() { + genericPNF = setupGenericTypeMock(GENERIC_PNF_NAME); - when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_PNF_NAME)) - .thenReturn(Either.left(genericPNF)); + when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_PNF_NAME)).thenReturn(Either.left(genericPNF)); Resource resource = createResourceObject(true); resource.setDerivedFrom(null); resource.setResourceType(ResourceTypeEnum.PNF); when(toscaOperationFacade.createToscaComponent(resource)).thenReturn(Either.left(resource)); - Either createResponse = bl.createResource(resource, - AuditingActionEnum.CREATE_RESOURCE, user, null, null); + when(genericTypeBusinessLogic.fetchDerivedFromGenericType(resource)).thenReturn(Either.left(genericPNF)); + when(genericTypeBusinessLogic.generateInputsFromGenericTypeProperties(genericPNF)).thenCallRealMethod(); + when(genericTypeBusinessLogic.convertGenericTypePropertiesToInputsDefintion(genericPNF.getProperties(), resource.getUniqueId())).thenCallRealMethod(); + Either createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); return createResponse.left().value(); } + - private Resource setupGenericTypeMock(String toscaName) { - + + private Resource setupGenericTypeMock(String toscaName) { + Resource genericType = createResourceObject(true); genericType.setVersion("1.0"); genericType.setToscaResourceName(toscaName); - String[] propNames = { "nf_function", "nf_role", "nf_naming_code", "nf_type", "nf_naming", - "availability_zone_max_count", "min_instances", "max_instances" }; - String[] propTypes = { "string", "string", "string", "string", "org.openecomp.datatypes.Naming", "integer", - "integer", "integer" }; + String[] propNames = {"nf_function", "nf_role", "nf_naming_code", "nf_type", "nf_naming", "availability_zone_max_count", "min_instances", "max_instances"}; + String[] propTypes = {"string", "string", "string", "string", "org.openecomp.datatypes.Naming", "integer", "integer", "integer"}; List genericProps = new ArrayList<>(); - for (int i = 0; i < 8; ++i) { + for(int i = 0; i < 8; ++i){ PropertyDefinition prop = new PropertyDefinition(); prop.setName(propNames[i]); prop.setType(propTypes[i]); @@ -1951,427 +1727,6 @@ public class ResourceBusinessLogicTest { return genericType; } - private ResourceBusinessLogic createTestSubject() { - return new ResourceBusinessLogic(); - } - - @Test - public void testGetCsarOperation() throws Exception { - ResourceBusinessLogic testSubject; - CsarOperation result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCsarOperation(); - } - - @Test - public void testSetCsarOperation() throws Exception { - ResourceBusinessLogic testSubject; - CsarOperation csarOperation = null; - - // default test - testSubject = createTestSubject(); - testSubject.setCsarOperation(csarOperation); - } - - - @Test - public void testGetLifecycleBusinessLogic() throws Exception { - ResourceBusinessLogic testSubject; - LifecycleBusinessLogic result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getLifecycleBusinessLogic(); - } - - - @Test - public void testSetLifecycleManager() throws Exception { - ResourceBusinessLogic testSubject; - LifecycleBusinessLogic lifecycleBusinessLogic = null; - - // default test - testSubject = createTestSubject(); - testSubject.setLifecycleManager(lifecycleBusinessLogic); - } - - - @Test - public void testGetElementDao() throws Exception { - ResourceBusinessLogic testSubject; - IElementOperation result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getElementDao(); - } - - - @Test - public void testSetElementDao() throws Exception { - ResourceBusinessLogic testSubject; - IElementOperation elementDao = null; - - // default test - testSubject = createTestSubject(); - testSubject.setElementDao(elementDao); - } - - - @Test - public void testGetUserAdmin() throws Exception { - ResourceBusinessLogic testSubject; - IUserBusinessLogic result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getUserAdmin(); - } - - - @Test - public void testSetUserAdmin() throws Exception { - ResourceBusinessLogic testSubject; - UserBusinessLogic userAdmin = null; - - // default test - testSubject = createTestSubject(); - testSubject.setUserAdmin(userAdmin); - } - - - @Test - public void testGetComponentsUtils() throws Exception { - ResourceBusinessLogic testSubject; - ComponentsUtils result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getComponentsUtils(); - } - - - @Test - public void testSetComponentsUtils() throws Exception { - ResourceBusinessLogic testSubject; - ComponentsUtils componentsUtils = null; - - // default test - testSubject = createTestSubject(); - testSubject.setComponentsUtils(componentsUtils); - } - - - @Test - public void testGetArtifactsManager() throws Exception { - ResourceBusinessLogic testSubject; - ArtifactsBusinessLogic result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getArtifactsManager(); - } - - - @Test - public void testSetArtifactsManager() throws Exception { - ResourceBusinessLogic testSubject; - ArtifactsBusinessLogic artifactsManager = null; - - // default test - testSubject = createTestSubject(); - testSubject.setArtifactsManager(artifactsManager); - } - - - @Test - public void testSetPropertyOperation() throws Exception { - ResourceBusinessLogic testSubject; - IPropertyOperation propertyOperation = null; - - // default test - testSubject = createTestSubject(); - testSubject.setPropertyOperation(propertyOperation); - } - - - @Test - public void testGetApplicationDataTypeCache() throws Exception { - ResourceBusinessLogic testSubject; - ApplicationDataTypeCache result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getApplicationDataTypeCache(); - } - - - @Test - public void testSetApplicationDataTypeCache() throws Exception { - ResourceBusinessLogic testSubject; - ApplicationDataTypeCache applicationDataTypeCache = null; - - // default test - testSubject = createTestSubject(); - testSubject.setApplicationDataTypeCache(applicationDataTypeCache); - } - - @Test - public void testSetDeploymentArtifactsPlaceHolder() throws Exception { - ResourceBusinessLogic testSubject; - Component component = new Resource() { - }; - User user = null; - - // default test - testSubject = createTestSubject(); - testSubject.setDeploymentArtifactsPlaceHolder(component, user); - } - - - - @Test - public void testValidateVendorReleaseName_1() throws Exception { - ResourceBusinessLogic testSubject; - String vendorRelease = ""; - Either result; - - // test 1 - testSubject = createTestSubject(); - vendorRelease = null; - result = testSubject.validateVendorReleaseName(vendorRelease); - Assert.assertEquals(false, result.left().value()); - - } - - - - - - - @Test - public void testGetCapabilityTypeOperation() throws Exception { - ResourceBusinessLogic testSubject; - ICapabilityTypeOperation result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCapabilityTypeOperation(); - } - - - @Test - public void testSetCapabilityTypeOperation() throws Exception { - ResourceBusinessLogic testSubject; - ICapabilityTypeOperation capabilityTypeOperation = null; - - // default test - testSubject = createTestSubject(); - testSubject.setCapabilityTypeOperation(capabilityTypeOperation); - } - - - @Test - public void testValidatePropertiesDefaultValues() throws Exception { - ResourceBusinessLogic testSubject; - Resource resource = new Resource(); - Either result; - - // default test - testSubject = createTestSubject(); - result = testSubject.validatePropertiesDefaultValues(resource); - } - - - @Test - public void testGetComponentInstanceBL() throws Exception { - ResourceBusinessLogic testSubject; - ComponentInstanceBusinessLogic result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getComponentInstanceBL(); - } - - - - @Test - public void testGetComponentInstancesFilteredByPropertiesAndInputs() throws Exception { - ResourceBusinessLogic testSubject; - String componentId = ""; - ComponentTypeEnum componentTypeEnum = null; - String userId = ""; - String searchText = ""; - Either, ResponseFormat> result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getComponentInstancesFilteredByPropertiesAndInputs(componentId, componentTypeEnum, userId, - searchText); - } - - - - @Test - public void testGetCacheManagerOperation() throws Exception { - ResourceBusinessLogic testSubject; - ICacheMangerOperation result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCacheManagerOperation(); - } - - - @Test - public void testSetCacheManagerOperation() throws Exception { - ResourceBusinessLogic testSubject; - ICacheMangerOperation cacheManagerOperation = null; - - // default test - testSubject = createTestSubject(); - testSubject.setCacheManagerOperation(cacheManagerOperation); - } - - - @Test - public void testGetElementDao_1() throws Exception { - ResourceBusinessLogic testSubject;IElementOperation result; - - // default test - testSubject=createTestSubject();result=testSubject.getElementDao(); - } - - - @Test - public void testGetAllCertifiedResources() throws Exception { - ResourceBusinessLogic testSubject;boolean getAbstract = false; - HighestFilterEnum highestFilter = null; - String userId = ""; - Either,ResponseFormat> result; - - // default test - } - - - @Test - public void testValidateResourceNameExists() throws Exception { - ResourceBusinessLogic testSubject;String resourceName = ""; - ResourceTypeEnum resourceTypeEnum = null; - String userId = ""; - Either,ResponseFormat> result; - - // default test - } - - - @Test - public void testCreateResource() throws Exception { - ResourceBusinessLogic testSubject;Resource resource = null; - AuditingActionEnum auditingAction = null; - User user = null; - Map csarUIPayload = null; - String payloadName = ""; - Either result; - - // test 1 - testSubject=createTestSubject();payloadName = null; - - // test 2 - testSubject=createTestSubject();payloadName = ""; - } - - - @Test - public void testValidateAndUpdateResourceFromCsar() throws Exception { - ResourceBusinessLogic testSubject;Resource resource = null; - User user = null; - Map csarUIPayload = null; - String payloadName = ""; - String resourceUniqueId = ""; - Either result; - - // test 1 - testSubject=createTestSubject();payloadName = null; - - // test 2 - testSubject=createTestSubject();payloadName = ""; - } - - - - - - - - - - - - @Test - public void testCreateResourceFromCsar() throws Exception { - ResourceBusinessLogic testSubject;Resource resource = null; - User user = null; - Either,StorageOperationStatus> csarUIPayload = null; - String csarUUID = ""; - Either result; - - // test 1 - testSubject=createTestSubject();csarUIPayload = null; - } - - - - - - - - @Test - public void testCreateResourcesFromYamlNodeTypesList() throws Exception { - ResourceBusinessLogic testSubject;String yamlName = ""; - Resource resource = null; - Map mappedToscaTemplate = null; - boolean needLock = false; - Map>> nodeTypesArtifactsToHandle = null; - List nodeTypesNewCreatedArtifacts = null; - Map nodeTypesInfo = null; - CsarInfo csarInfo = null; - Either,ResponseFormat> result; - - // default test - } - - - - - - - @Test - public void testValidateResourceCreationFromNodeType() throws Exception { - ResourceBusinessLogic testSubject;Resource resource = null; - User creator = null; - Either result; - - // default test - } - - - @Test - public void testCreateResourceFromNodeType() throws Exception { - ResourceBusinessLogic testSubject;String nodeTypeYaml = ""; - UploadResourceInfo resourceMetaData = null; - User creator = null; - boolean isInTransaction = false; - boolean needLock = false; - Map> nodeTypeArtifactsToHandle = null; - List nodeTypesNewCreatedArtifacts = null; - boolean forceCertificationAllowed = false; - CsarInfo csarInfo = null; - Either,ResponseFormat> result; - - // default test - } - + + } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceInstanceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceInstanceBusinessLogicTest.java index a3022330a1..581adb28df 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceInstanceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceInstanceBusinessLogicTest.java @@ -20,7 +20,16 @@ package org.openecomp.sdc.be.components.impl; -import fj.data.Either; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -52,13 +61,7 @@ import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.*; +import fj.data.Either; public class ResourceInstanceBusinessLogicTest { @@ -141,8 +144,8 @@ public class ResourceInstanceBusinessLogicTest { StorageOperationStatus status = StorageOperationStatus.OK; Mockito.when(toscaOperationFacade.addDeploymentArtifactsToInstance(Mockito.any(String.class), Mockito.any(ComponentInstance.class), Mockito.any(Map.class))).thenReturn(status); - Mockito.when(toscaOperationFacade.addInformationalArtifactsToInstance(Mockito.any(String.class), Mockito.any(ComponentInstance.class), Mockito.any(Map.class))).thenReturn(status); - Mockito.when(toscaOperationFacade.addGroupInstancesToComponentInstance(Mockito.any(Component.class), Mockito.any(ComponentInstance.class), Mockito.any(List.class), Mockito.any(Map.class))).thenReturn(status); + Mockito.when(toscaOperationFacade.addInformationalArtifactsToInstance(Mockito.any(String.class), Mockito.any(ComponentInstance.class), Mockito.any())).thenReturn(status); + Mockito.when(toscaOperationFacade.addGroupInstancesToComponentInstance(Mockito.any(Component.class), Mockito.any(ComponentInstance.class), Mockito.any(), Mockito.any(Map.class))).thenReturn(status); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java new file mode 100644 index 0000000000..309689af45 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java @@ -0,0 +1,97 @@ +package org.openecomp.sdc.be.components.impl.generic; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.exception.ResponseFormat; + +import fj.data.Either; + +public class GenericTypeBusinessLogicTest { + + @InjectMocks + private GenericTypeBusinessLogic testInstance; + + @Mock + private ToscaOperationFacade toscaOperationFacadeMock; + + @Before + public void setUp() throws Exception { + testInstance = new GenericTypeBusinessLogic(); + MockitoAnnotations.initMocks(this); + + } + + @Test + public void fetchDerivedFromGenericType_cvfv_getGenericResourceTypeFromDerivedFrom() throws Exception { + Resource cvfc = new Resource(); + cvfc.setResourceType(ResourceTypeEnum.CVFC); + cvfc.setDerivedFrom(Arrays.asList("genericType", "someOtherType")); + Resource genericResource = new Resource(); + when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName("genericType")).thenReturn(Either.left(genericResource)); + Either fetchedGenericType = testInstance.fetchDerivedFromGenericType(cvfc); + assertEquals(genericResource, fetchedGenericType.left().value()); + } + + @Test + public void fetchDerivedFromGenericType_getGenericResourceTypeFromConfiguration() throws Exception { + Resource resource = Mockito.mock(Resource.class); + when(resource.getResourceType()).thenReturn(ResourceTypeEnum.VF); + when(resource.fetchGenericTypeToscaNameFromConfig()).thenReturn("genericType"); + Resource genericResource = new Resource(); + when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName("genericType")).thenReturn(Either.left(genericResource)); + Either fetchedGenericType = testInstance.fetchDerivedFromGenericType(resource); + assertEquals(genericResource, fetchedGenericType.left().value()); + } + + @Test + public void generateInputsFromGenericTypeProperties() throws Exception { + Resource genericNodeType = new Resource(); + genericNodeType.setUniqueId("genericUid"); + PropertyDefinition propertyDefinition = generatePropDefinition("prop1"); + PropertyDefinition propertyDefinition2 = generatePropDefinition("prop2"); + + genericNodeType.setProperties(Arrays.asList(propertyDefinition, propertyDefinition2)); + + List genericInputs = testInstance.generateInputsFromGenericTypeProperties(genericNodeType); + assertEquals(2, genericInputs.size()); + assertInput(genericInputs.get(0), propertyDefinition); + assertInput(genericInputs.get(1), propertyDefinition2); + } + + @Test + public void generateInputsFromGenericTypeProperties_genericHasNoProps() throws Exception { + Resource genericNodeType = new Resource(); + assertTrue(testInstance.generateInputsFromGenericTypeProperties(genericNodeType).isEmpty()); + } + + private void assertInput(InputDefinition inputDefinition, PropertyDefinition propertyDefinition) { + assertEquals(inputDefinition.getOwnerId(), "genericUid"); + assertEquals(inputDefinition.getValue(), propertyDefinition.getValue()); + assertEquals(inputDefinition.getName(), propertyDefinition.getName()); + } + + private PropertyDefinition generatePropDefinition(String name) { + PropertyDefinition propertyDefinition = new PropertyDefinition(); + propertyDefinition.setName(name); + propertyDefinition.setValue(name + "value"); + return propertyDefinition; + } + + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransitionTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransitionTest.java index 72c58c02f0..31c795478a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransitionTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationChangeTransitionTest.java @@ -22,23 +22,16 @@ package org.openecomp.sdc.be.components.lifecycle; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; -import org.openecomp.sdc.be.components.lifecycle.CertificationChangeTransition; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.exception.ResponseFormat; @@ -51,11 +44,8 @@ public class CertificationChangeTransitionTest extends LifecycleTestBase { private CertificationChangeTransition certificationFailObj = null; private ComponentsUtils componentsUtils = new ComponentsUtils(); - private String resourceName = "myResource"; private User owner = null; - protected ArtifactsBusinessLogic artifactsManager = Mockito.mock(ArtifactsBusinessLogic.class); - Resource resource; @SuppressWarnings("unchecked") @@ -79,8 +69,7 @@ public class CertificationChangeTransitionTest extends LifecycleTestBase { owner = new User("cs0008", "Carlos", "Santana", "cs@sdc.com", "DESIGNER", null); - when(artifactsManager.deleteAllComponentArtifactsIfNotOnGraph(Mockito.anyList())).thenReturn(StorageOperationStatus.OK); - resource = createResourceObject(false); + resource = createResourceObject(); } @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTest.java index 6bfd64be41..5530d4c0f5 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CertificationRequestTest.java @@ -20,13 +20,20 @@ package org.openecomp.sdc.be.components.lifecycle; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.List; + import org.apache.http.HttpStatus; import org.junit.Before; import org.junit.Test; -import org.mockito.InjectMocks; +import org.junit.runner.RunWith; +import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; import org.openecomp.sdc.be.dao.api.ActionStatus; @@ -44,46 +51,40 @@ import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.CapabilityOperation; -import org.openecomp.sdc.be.tosca.ToscaError; import org.openecomp.sdc.be.tosca.ToscaExportHandler; -import org.openecomp.sdc.be.tosca.ToscaRepresentation; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.exception.ResponseFormat; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; +import fj.data.Either; +@RunWith(MockitoJUnitRunner.Silent.class) public class CertificationRequestTest extends LifecycleTestBase { private ComponentsUtils componentsUtils = new ComponentsUtils(); + @Mock + private ServiceDistributionArtifactsBuilder serviceDistributionArtifactsBuilder; + @Mock + private ServiceBusinessLogic serviceBusinessLogic; + @Mock + private CapabilityOperation capabilityOperation; + @Mock + private ToscaExportHandler toscaExportUtils; - protected ServiceDistributionArtifactsBuilder serviceDistributionArtifactsBuilder = Mockito.mock(ServiceDistributionArtifactsBuilder.class); - protected ServiceBusinessLogic serviceBusinessLogic = Mockito.mock(ServiceBusinessLogic.class); - protected CapabilityOperation capabilityOperation = Mockito.mock(CapabilityOperation.class); - protected ToscaExportHandler toscaExportUtils = Mockito.mock(ToscaExportHandler.class); - @InjectMocks - private CertificationRequestTransition rfcObj = new CertificationRequestTransition(componentsUtils, toscaElementLifecycleOperation, serviceDistributionArtifactsBuilder, serviceBusinessLogic, capabilityOperation, toscaExportUtils, toscaOperationFacade, titanDao); + private CertificationRequestTransition rfcObj; - protected ToscaRepresentation toscaRepresentation = Mockito.mock(ToscaRepresentation.class); @Before public void setup() { - MockitoAnnotations.initMocks(this); super.setup(); - + rfcObj = new CertificationRequestTransition(componentsUtils, toscaElementLifecycleOperation, serviceDistributionArtifactsBuilder, serviceBusinessLogic, capabilityOperation, toscaExportUtils, toscaOperationFacade, titanDao); // checkout transition object - rfcObj.setLifeCycleOperation(toscaElementLifecycleOperation); +// rfcObj.setLifeCycleOperation(toscaElementLifecycleOperation); // checkoutObj.setAuditingManager(iAuditingManager); rfcObj.setConfigurationManager(configurationManager); componentsUtils.Init(); - Either either = Either.left(toscaRepresentation); - when(toscaExportUtils.exportComponent(Mockito.anyObject())).thenReturn(either); - +// Either either = Either.left(toscaRepresentation); +// when(toscaExportUtils.exportComponent(Mockito.any())).thenReturn(either); } @Test @@ -109,7 +110,7 @@ public class CertificationRequestTest extends LifecycleTestBase { @Test public void testCheckoutStateValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN); Either ownerResponse = rfcObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -130,7 +131,7 @@ public class CertificationRequestTest extends LifecycleTestBase { @Test public void testAlreadyRfc() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.READY_FOR_CERTIFICATION); Either ownerResponse = rfcObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -146,7 +147,7 @@ public class CertificationRequestTest extends LifecycleTestBase { @Test public void testCertificationInProgress() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS); Either ownerResponse = rfcObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -162,7 +163,7 @@ public class CertificationRequestTest extends LifecycleTestBase { @Test public void testAlreadyCertified() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.CERTIFIED); Either ownerResponse = rfcObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckinTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckinTest.java index 6a009d06c5..21111ef59e 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckinTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckinTest.java @@ -25,9 +25,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.be.components.lifecycle.CheckinTransition; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.LifecycleStateEnum; @@ -59,7 +57,7 @@ public class CheckinTest extends LifecycleTestBase { @Test public void testSimpleCheckin() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); Either ownerResponse = checkinObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -87,7 +85,7 @@ public class CheckinTest extends LifecycleTestBase { @Test public void testCheckinTwiceValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN); Either owner = checkinObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -122,7 +120,7 @@ public class CheckinTest extends LifecycleTestBase { @Test public void testCheckoutByAnotherUserValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); User modifier = new User(); modifier.setUserId("modifier"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTest.java index 4a10bbfba4..1e3f6f6ce8 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/CheckoutTest.java @@ -27,7 +27,6 @@ import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; -import org.openecomp.sdc.be.components.lifecycle.CheckoutTransition; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -57,13 +56,15 @@ public class CheckoutTest extends LifecycleTestBase { checkoutObj.setLifeCycleOperation(toscaElementLifecycleOperation); checkoutObj.setConfigurationManager(configurationManager); componentsUtils.Init(); + bl.setToscaOperationFacade(toscaOperationFacade); + bl.setComponentsUtils(componentsUtils); } @Test public void testCheckoutStateValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN); Either ownerResponse = checkoutObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -81,7 +82,7 @@ public class CheckoutTest extends LifecycleTestBase { @Test public void testAlreadyCheckout() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); Either ownerResponse = checkoutObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -99,7 +100,7 @@ public class CheckoutTest extends LifecycleTestBase { @Test public void testCertificationInProgress() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS); Either ownerResponse = checkoutObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -119,7 +120,7 @@ public class CheckoutTest extends LifecycleTestBase { @Test public void testReadyForCertification() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.READY_FOR_CERTIFICATION); @@ -159,7 +160,7 @@ public class CheckoutTest extends LifecycleTestBase { @Test public void testRoles() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/LifecycleTestBase.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/LifecycleTestBase.java index ff5c618138..bc131ff39a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/LifecycleTestBase.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/LifecycleTestBase.java @@ -27,6 +27,7 @@ import java.util.List; import javax.servlet.ServletContext; +import org.junit.BeforeClass; import org.mockito.InjectMocks; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; @@ -39,7 +40,6 @@ import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.ArtifactDefinition; @@ -67,11 +67,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import fj.data.Either; -import junit.framework.Assert; public class LifecycleTestBase { private static Logger log = LoggerFactory.getLogger(LifecycleTestBase.class.getName()); @@ -86,19 +82,22 @@ public class LifecycleTestBase { protected User user = null; protected Resource resourceResponse; protected Service serviceResponse; - protected ConfigurationManager configurationManager = null; + protected static ConfigurationManager configurationManager = null; protected ResponseFormatManager responseManager = null; protected TitanDao titanDao = Mockito.mock(TitanDao.class); protected ToscaOperationFacade toscaOperationFacade = Mockito.mock(ToscaOperationFacade.class); - public void setup() { - + @BeforeClass + public static void setupClass() { ExternalConfiguration.setAppName("catalog-be"); // Init Configuration String appConfigDir = "src/test/resources/config/catalog-be"; ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); configurationManager = new ConfigurationManager(configurationSource); + } + + public void setup() { // Auditing iAuditingManager = new AuditingMockManager("lll"); @@ -124,7 +123,7 @@ public class LifecycleTestBase { // getCount // createResource - resourceResponse = createResourceObject(true); + resourceResponse = createResourceObject(); Either eitherComponent = Either.left(ModelConverter.convertToToscaElement(resourceResponse)); when(toscaElementLifecycleOperation.checkoutToscaElement(Mockito.any(String.class), Mockito.any(String.class), Mockito.any(String.class))) .thenAnswer(createAnswer(eitherComponent)); @@ -137,7 +136,10 @@ public class LifecycleTestBase { Either getOwnerResult = Either.left(user); when(toscaElementLifecycleOperation.getToscaElementOwner(Mockito.anyString())).thenReturn(getOwnerResult); - + + Either eitherlatestDerived = Either.right(StorageOperationStatus.OK); + when(toscaOperationFacade.shouldUpgradeToLatestDerived(Mockito.any(Resource.class))).thenReturn(eitherlatestDerived); + responseManager = ResponseFormatManager.getInstance(); } @@ -153,9 +155,10 @@ public class LifecycleTestBase { return dummy; } - protected Resource createResourceObject(boolean afterCreate) { + protected Resource createResourceObject() { Resource resource = new Resource(); resource.setName("MyResourceName"); + resource.setUniqueId("uid"); resource.addCategory("VoIP", "INfra"); resource.setDescription("My short description"); List tgs = new ArrayList(); @@ -179,6 +182,7 @@ public class LifecycleTestBase { ComponentMetadataDefinition cMetadataDataDefinition = new ComponentMetadataDefinition(rMetadataDataDefinition) ; Resource resource = new Resource(cMetadataDataDefinition); + resource.setUniqueId("rid"); resource.setName("MyResourceVFCMTName"); resource.addCategory("VoIP", "INfra"); resource.setDescription("My short description"); @@ -200,6 +204,7 @@ public class LifecycleTestBase { protected Service createServiceObject(boolean b) { Service service = new Service(); service.setName("MyServiceName"); + service.setUniqueId("sid"); service.addCategory("VoIP", null); service.setDescription("My short description"); List tgs = new ArrayList(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTest.java index 6761721636..11913ad31a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTest.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.be.components.lifecycle.UndoCheckoutTransition; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -58,7 +57,7 @@ public class UndoCheckoutTest extends LifecycleTestBase { @Test public void testResourceNotCheckedOutValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN); Either ownerResponse = undoCheckoutObj.getComponentOwner(resource, ComponentTypeEnum.RESOURCE); @@ -102,7 +101,7 @@ public class UndoCheckoutTest extends LifecycleTestBase { @Test public void testDifferentResourceOwnerValidation() { Either changeStateResult; - Resource resource = createResourceObject(false); + Resource resource = createResourceObject(); resource.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); User modifier = new User(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogicTest.java new file mode 100644 index 0000000000..ab2e865ae0 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalInputsFilteringBusinessLogicTest.java @@ -0,0 +1,86 @@ +package org.openecomp.sdc.be.components.merge; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.impl.generic.GenericTypeBusinessLogic; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import com.google.common.collect.Sets; + +import fj.data.Either; + +public class GlobalInputsFilteringBusinessLogicTest { + + private static final String GENERIC_TOSCA_TYPE = "myGenericType"; + + @InjectMocks + private GlobalInputsFilteringBusinessLogic testInstance; + + @Mock + private GenericTypeBusinessLogic genericTypeBusinessLogicMock; + + @Mock + private ToscaOperationFacade toscaOperationFacadeMock; + + @Mock + private ComponentsUtils componentsUtils; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testFilterGlobalInputs() throws Exception { + Resource mockResource = Mockito.mock(Resource.class); + String myGenericType = GENERIC_TOSCA_TYPE; + String[] genericProperties = {"property1", "property2"}; + String[] allInputs = {"property1", "property2", "property3", "property4"}; + when(mockResource.fetchGenericTypeToscaNameFromConfig()).thenReturn(myGenericType); + when(mockResource.getInputs()).thenReturn(ObjectGenerator.buildInputs(allInputs)); + Resource genericNodeType = ObjectGenerator.buildResourceWithProperties(genericProperties); + when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName(myGenericType)).thenReturn(Either.left(genericNodeType)); + when(genericTypeBusinessLogicMock.generateInputsFromGenericTypeProperties(genericNodeType)).thenReturn(ObjectGenerator.buildInputs(genericProperties)); + Either, ActionStatus> globalInputsEither = testInstance.filterGlobalInputs(mockResource); + verifyFilteredOnlyGlobalInputs(globalInputsEither, genericProperties); + } + + @Test + public void testFilterGlobalInputs_errorGettingGenericType_convertToActionStatusAndReturn() throws Exception { + Resource mockResource = Mockito.mock(Resource.class); + when(mockResource.fetchGenericTypeToscaNameFromConfig()).thenReturn(GENERIC_TOSCA_TYPE); + when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_TOSCA_TYPE)).thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + Either, ActionStatus> globalInputsEither = testInstance.filterGlobalInputs(mockResource); + assertTrue(globalInputsEither.isRight()); + assertEquals(ActionStatus.GENERAL_ERROR, globalInputsEither.right().value()); + verifyZeroInteractions(genericTypeBusinessLogicMock); + } + + private void verifyFilteredOnlyGlobalInputs(Either, ActionStatus> globalInputsEither, String[] genericProperties) { + assertTrue(globalInputsEither.isLeft()); + List globalInputs = globalInputsEither.left().value(); + assertEquals(2, globalInputs.size()); + Set actualGlobalInputNames = globalInputs.stream().map(InputDefinition::getName).collect(Collectors.toSet()); + assertEquals(Sets.newHashSet(genericProperties), actualGlobalInputNames); + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogicTest.java new file mode 100644 index 0000000000..a00b0b8e8a --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/GlobalTypesMergeBusinessLogicTest.java @@ -0,0 +1,62 @@ +package org.openecomp.sdc.be.components.merge; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; +import static org.openecomp.sdc.be.components.utils.ObjectGenerator.buildResourceWithInputs; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; + +import fj.data.Either; + +public class GlobalTypesMergeBusinessLogicTest { + + @InjectMocks + private GlobalTypesMergeBusinessLogic testInstance; + + @Mock + private ComponentInputsMergeBL resourceInputsMergeBLMock; + + @Mock + private GlobalInputsFilteringBusinessLogic globalInputsFilteringBusinessLogic; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergeInstancePropsAndInputs_mergeOnlyNewResourceGenericGlobalTypes() { + Resource oldResource = buildResourceWithInputs("input1", "input2"); + Resource newResource = buildResourceWithInputs("input1", "input2", "global1", "global2"); + List globalInputs = Arrays.asList(newResource.getInputs().get(2), newResource.getInputs().get(3)); + when(globalInputsFilteringBusinessLogic.filterGlobalInputs(newResource)).thenReturn(Either.left(globalInputs)); + when(resourceInputsMergeBLMock.mergeComponentInputs(oldResource, newResource, globalInputs)).thenReturn(ActionStatus.OK); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(ActionStatus.OK, actionStatus); + + } + + @Test + public void mergeInstancePropsAndInputs_failedToFilterGlobalInputs() throws Exception { + Resource oldResource = buildResourceWithInputs("input1", "input2"); + Resource newResource = buildResourceWithInputs("input1", "input2", "global1", "global2"); + when(globalInputsFilteringBusinessLogic.filterGlobalInputs(newResource)).thenReturn(Either.right(ActionStatus.GENERAL_ERROR)); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(actionStatus, ActionStatus.GENERAL_ERROR); + verifyZeroInteractions(resourceInputsMergeBLMock); + } + + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/RelationsComparatorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/RelationsComparatorTest.java new file mode 100644 index 0000000000..773b068cd7 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/RelationsComparatorTest.java @@ -0,0 +1,112 @@ +package org.openecomp.sdc.be.components.merge; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.be.components.utils.ComponentInstanceBuilder; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.components.utils.RelationsBuilder; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.Resource; + +public class RelationsComparatorTest { + + public static final String INSTANCE1 = "instance1"; + public static final String INSTANCE2 = "instance2"; + RelationsComparator testInstance; + + private RequirementCapabilityRelDef relation1, relation2, relation3, relation4; + private ComponentInstance componentInstance1, componentInstance2; + + @Before + public void setUp() { + testInstance = new RelationsComparator(); + componentInstance1 = new ComponentInstanceBuilder().setName(INSTANCE1).setId(INSTANCE1).build(); + componentInstance2 = new ComponentInstanceBuilder().setName(INSTANCE2).setId(INSTANCE2).build(); + buildRelations(); + } + + @Test + public void isRelationsChanged_sameRelationships() throws Exception { + Resource oldResource = ObjectGenerator.buildResourceWithRelationships(relation1, relation2, relation3, relation4); + oldResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + Resource newResource = ObjectGenerator.buildResourceWithRelationships(relation4, relation3, relation1, relation2); + newResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + assertFalse(testInstance.isRelationsChanged(oldResource, newResource)); + } + + @Test + public void isRelationsChanged_notSameAmountOfRelations() { + Resource oldResource = ObjectGenerator.buildResourceWithRelationships(relation1, relation2); + oldResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + Resource newResource = ObjectGenerator.buildResourceWithRelationships(relation1, relation2, relation3); + newResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + assertTrue(testInstance.isRelationsChanged(oldResource, newResource)); + } + + @Test + public void isRelationsChanged_notSameFromNode() throws Exception { + RequirementCapabilityRelDef relation2DifType = buildRelation("2", INSTANCE1); + relation2DifType.setFromNode(INSTANCE2); + isRelationsChangedTest(relation2DifType); + } + + @Test + public void isRelationsChanged_notSameType() throws Exception { + RequirementCapabilityRelDef relation2DifType = buildRelation("2", INSTANCE1); + relation2DifType.getSingleRelationship().getRelation().getRelationship().setType("someDiffType"); + isRelationsChangedTest(relation2DifType); + } + + @Test + public void isRelationsChanged_notSameCapability() throws Exception { + RequirementCapabilityRelDef relation2DifType = buildRelation("2", INSTANCE1); + relation2DifType.getSingleRelationship().getRelation().setCapabilityUid("someDiffUid"); + isRelationsChangedTest(relation2DifType); + } + + @Test + public void isRelationsChanged_notSameReqName() throws Exception { + RequirementCapabilityRelDef relation2DifType = buildRelation("2", INSTANCE1); + relation2DifType.getSingleRelationship().getRelation().setRequirement("someDiffReq"); + isRelationsChangedTest(relation2DifType); + } + + @Test + public void isRelationsChanged_notSameToNode() throws Exception { + RequirementCapabilityRelDef relation2DifType = buildRelation("2", INSTANCE1); + relation2DifType.setToNode("someDiffNode"); + isRelationsChangedTest(relation2DifType); + } + + private void isRelationsChangedTest(RequirementCapabilityRelDef relation2DifType) { + Resource oldResource = ObjectGenerator.buildResourceWithRelationships(relation1, relation2); + oldResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + Resource newResource = ObjectGenerator.buildResourceWithRelationships(relation1, relation2DifType); + newResource.setComponentInstances(Arrays.asList(componentInstance1, componentInstance2)); + assertTrue(testInstance.isRelationsChanged(oldResource, newResource)); + } + + + private void buildRelations() { + relation1 = buildRelation("1", INSTANCE1); + relation2 = buildRelation("2", INSTANCE1); + relation3 = buildRelation("3", INSTANCE2); + relation4 = buildRelation("4", INSTANCE2); + } + + private RequirementCapabilityRelDef buildRelation(String postFix, String instance) { + return new RelationsBuilder() + .setFromNode(instance) + .setCapabilityUID("cap" + postFix) + .setRelationType("type" + postFix) + .setRequirementName("req" + postFix) + .setToNode(instance) + .build(); + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/TopologyComparatorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/TopologyComparatorTest.java new file mode 100644 index 0000000000..3b1ed52550 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/TopologyComparatorTest.java @@ -0,0 +1,119 @@ +package org.openecomp.sdc.be.components.merge; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ComponentInstanceBuilder; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +public class TopologyComparatorTest { + + @InjectMocks + private TopologyComparator testInstance; + + @Mock + private RelationsComparator relationsComparator; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Mock + private ComponentsUtils componentsUtils; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void compareTopologies_NotSameNumOfInstances() throws Exception { + Resource resourceWith2Instances = ObjectGenerator.buildResourceWithComponentInstance("inst1", "inst2"); + Resource resourceWith1Instances = ObjectGenerator.buildResourceWithComponentInstance("inst1"); + Resource resourceWithNoInstances = new Resource(); + assertTrue(testInstance.isTopologyChanged(resourceWithNoInstances, resourceWith2Instances).left().value()); + assertTrue(testInstance.isTopologyChanged(resourceWithNoInstances, resourceWith1Instances).left().value()); + assertTrue(testInstance.isTopologyChanged(resourceWith1Instances, resourceWith2Instances).left().value()); + } + + @Test + public void compareTopologies_notSameInstanceNames() throws Exception { + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstance("inst1", "inst2"); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstance("inst1", "inst3"); + assertTrue(testInstance.isTopologyChanged(resource1, resource2).left().value()); + } + + @Test + public void compareTopologies_notSameInstanceTypes_notSameOriginInstanceTypes() throws Exception { + ComponentInstance inst1 = new ComponentInstanceBuilder().setName("inst1").setComponentUid("inst1").setToscaName("a.b.c").build(); + ComponentInstance inst2 = new ComponentInstanceBuilder().setName("inst2").setComponentUid("inst2").setToscaName("a.b.c.d").build(); + ComponentInstance inst2DiffType = new ComponentInstanceBuilder().setName("inst2").setComponentUid("inst2DiffType").setToscaName("a.b.c.d.e").build(); + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2DiffType); + Resource inst2OriginResource = new ResourceBuilder().setInvariantUUid("inst2Invariant").build(); + Resource inst2DiffTypeOriginResource = new ResourceBuilder().setInvariantUUid("inst2DiffTypeInvariant").build(); + when(toscaOperationFacade.getToscaElement(inst2.getComponentUid())).thenReturn(Either.left(inst2OriginResource)); + when(toscaOperationFacade.getToscaElement(inst2DiffType.getComponentUid())).thenReturn(Either.left(inst2DiffTypeOriginResource)); + assertTrue(testInstance.isTopologyChanged(resource1, resource2).left().value()); + } + + @Test + public void compareTopologies_notSameInstanceTypes_failToFetchOriginComponent() throws Exception { + ComponentInstance inst1 = new ComponentInstanceBuilder().setName("inst1").setComponentUid("inst1").setToscaName("a.b.c").build(); + ComponentInstance inst1DiffOriginCmpt = new ComponentInstanceBuilder().setName("inst1").setComponentUid("inst1Diff").setToscaName("a.b.c.d").build(); + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstances(inst1); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstances(inst1DiffOriginCmpt); + when(toscaOperationFacade.getToscaElement(inst1.getComponentUid())).thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + assertEquals(ActionStatus.GENERAL_ERROR, testInstance.isTopologyChanged(resource1, resource2).right().value()); + } + + @Test + public void compareTopologies_notSameRelations() throws Exception { + ComponentInstance inst1 = new ComponentInstanceBuilder().setName("inst1").setToscaName("a.b.c").build(); + ComponentInstance inst2 = new ComponentInstanceBuilder().setName("inst2").setToscaName("a.b.c.d").build(); + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + when(relationsComparator.isRelationsChanged(resource1, resource2)).thenReturn(true); + assertTrue(testInstance.isTopologyChanged(resource1, resource2).left().value()); + } + + @Test + public void compareTopologies_sameInstances_sameRelations_noTopologyChange() throws Exception { + ComponentInstance inst1 = new ComponentInstanceBuilder().setName("inst1").setToscaName("a.b.c").build(); + ComponentInstance inst2 = new ComponentInstanceBuilder().setName("inst2").setToscaName("a.b.c.d").build(); + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + when(relationsComparator.isRelationsChanged(resource1, resource2)).thenReturn(false); + assertFalse(testInstance.isTopologyChanged(resource1, resource2).left().value()); + } + + @Test + public void compareTopologies_sameInstancesInvariant_sameRelations_noTopologyChange() throws Exception { + ComponentInstance inst1 = new ComponentInstanceBuilder().setName("inst1").setComponentUid("inst1").setToscaName("a.b.c").build(); + ComponentInstance inst2 = new ComponentInstanceBuilder().setName("inst2").setComponentUid("inst2").setToscaName("a.b.c.d").build(); + ComponentInstance inst2DiffType = new ComponentInstanceBuilder().setName("inst2").setComponentUid("inst2DiffType").setToscaName("a.b.c.d.e").build(); + Resource resource1 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2); + Resource resource2 = ObjectGenerator.buildResourceWithComponentInstances(inst1, inst2DiffType); + Resource inst2OriginResource = new ResourceBuilder().setInvariantUUid("inst2Invariant").build(); + when(toscaOperationFacade.getToscaElement(inst2.getComponentUid())).thenReturn(Either.left(inst2OriginResource)); + when(toscaOperationFacade.getToscaElement(inst2DiffType.getComponentUid())).thenReturn(Either.left(inst2OriginResource)); + when(relationsComparator.isRelationsChanged(resource1, resource2)).thenReturn(false); + assertFalse(testInstance.isTopologyChanged(resource1, resource2).left().value()); + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogicTest.java new file mode 100644 index 0000000000..bcdd08e95b --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/heat/HeatEnvArtifactsMergeBusinessLogicTest.java @@ -0,0 +1,112 @@ +package org.openecomp.sdc.be.components.merge.heat; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.be.components.utils.ArtifactBuilder; +import org.openecomp.sdc.be.components.utils.HeatParameterBuilder; +import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.HeatParameterDefinition; + +public class HeatEnvArtifactsMergeBusinessLogicTest { + + private HeatEnvArtifactsMergeBusinessLogic testInstance; + + @Before + public void setUp() throws Exception { + testInstance = new HeatEnvArtifactsMergeBusinessLogic(); + } + + @Test + public void mergeHeatEnvParameter_diffArtifactLabel_noMerging() throws Exception { + HeatParameterDefinition newHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1NewValue"); + HeatParameterDefinition prevHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1PrevValue"); + + ArtifactDefinition oldArtifact = buildHeatArtifact("artifact1", prevHeatParam1); + ArtifactDefinition newArtifact = buildHeatArtifact("artifact2", newHeatParam1); + List mergedArtifacts = testInstance.mergeInstanceHeatEnvArtifacts(Collections.singletonList(oldArtifact), Collections.singletonList(newArtifact)); + assertEquals(0, mergedArtifacts.size()); + assertEquals("param1NewValue", newArtifact.getHeatParameters().get(0).getCurrentValue()); + } + + @Test + public void mergeHeatEnvParameter_diffHeatParamName_noMerge() throws Exception { + HeatParameterDefinition newHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1NewValue"); + HeatParameterDefinition prevHeatParam1 = buildHeatParameterDefinition("param2", "type1", "param1PrevValue"); + ArtifactDefinition oldArtifact = buildHeatArtifact("artifact1", prevHeatParam1); + ArtifactDefinition newArtifact = buildHeatArtifact("artifact1", newHeatParam1); + List mergedArtifacts = testInstance.mergeInstanceHeatEnvArtifacts(Collections.singletonList(oldArtifact), Collections.singletonList(newArtifact)); + assertEquals(0, mergedArtifacts.size()); + assertEquals("param1NewValue", newArtifact.getHeatParameters().get(0).getCurrentValue()); + } + + @Test + public void mergeHeatEnvParameter_diffHeatParamType_noMerge() throws Exception { + HeatParameterDefinition newHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1NewValue"); + HeatParameterDefinition prevHeatParam1 = buildHeatParameterDefinition("param1", "type2", "param1PrevValue"); + ArtifactDefinition oldArtifact = buildHeatArtifact("artifact1", prevHeatParam1); + ArtifactDefinition newArtifact = buildHeatArtifact("artifact1", newHeatParam1); + List mergedArtifacts = testInstance.mergeInstanceHeatEnvArtifacts(Collections.singletonList(oldArtifact), Collections.singletonList(newArtifact)); + assertEquals(0, mergedArtifacts.size()); + assertEquals("param1NewValue", newArtifact.getHeatParameters().get(0).getCurrentValue()); + } + + @Test + public void mergeHeatEnvParameter__diffOldAndNewValues_overrideNewValueWithOldValue() throws Exception { + HeatParameterDefinition newHeatParam1 = buildHeatParameterDefinition("param1", "type1", null); + HeatParameterDefinition newHeatParam2 = buildHeatParameterDefinition("param2", "type1", "param2value"); + + HeatParameterDefinition prevHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1PrevValue"); + HeatParameterDefinition prevHeatParam2 = buildHeatParameterDefinition("param2", "type1", "param2PrevValue"); + + ArtifactDefinition oldArtifact = buildHeatArtifact("artifact1", prevHeatParam1, prevHeatParam2); + ArtifactDefinition newArtifact = buildHeatArtifact("artifact1", newHeatParam1, newHeatParam2); + + List mergedArtifacts = testInstance.mergeInstanceHeatEnvArtifacts(Collections.singletonList(oldArtifact), Collections.singletonList(newArtifact)); + assertEquals(1, mergedArtifacts.size()); + List heatParameters = mergedArtifacts.get(0).getHeatParameters(); + assertEquals("param1PrevValue", heatParameters.get(0).getCurrentValue()); + assertEquals("param2PrevValue", heatParameters.get(1).getCurrentValue()); + } + + @Test + public void mergeHeatEnvParameter_multipleArtifacts() throws Exception { + HeatParameterDefinition newHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1Newvalue"); + HeatParameterDefinition newHeatParam2 = buildHeatParameterDefinition("param2", "type1", "param2Newvalue"); + HeatParameterDefinition newHeatParam3 = buildHeatParameterDefinition("param2", "type1", "param3Newvalue"); + + HeatParameterDefinition prevHeatParam1 = buildHeatParameterDefinition("param1", "type1", "param1PrevValue"); + HeatParameterDefinition prevHeatParam2 = buildHeatParameterDefinition("param2", "type1", "param2PrevValue"); + HeatParameterDefinition prevHeatParam3 = buildHeatParameterDefinition("param3", "type2", "param3PrevValue"); + + ArtifactDefinition oldArtifact1 = buildHeatArtifact("artifact1", prevHeatParam1); + ArtifactDefinition oldArtifact2 = buildHeatArtifact("artifact2", prevHeatParam2); + ArtifactDefinition oldArtifact3 = buildHeatArtifact("artifact3", prevHeatParam3); + + ArtifactDefinition newArtifact1 = buildHeatArtifact("artifact1", newHeatParam1); + ArtifactDefinition newArtifact2 = buildHeatArtifact("artifact2New", newHeatParam2); + ArtifactDefinition newArtifact3 = buildHeatArtifact("artifact3", newHeatParam3); + + List mergedArtifacts = testInstance.mergeInstanceHeatEnvArtifacts(Arrays.asList(oldArtifact1, oldArtifact2, oldArtifact3), Arrays.asList(newArtifact1, newArtifact2, newArtifact3)); + assertEquals(1, mergedArtifacts.size());//artifact 2 not merged as it has different label, artifact 3 not merged as the heat parameter has diff types + assertEquals("artifact1", mergedArtifacts.get(0).getArtifactLabel()); + } + + private HeatParameterDefinition buildHeatParameterDefinition(String name, String type, String val) { + return new HeatParameterBuilder().setName(name).setType(type).setCurrentValue(val).build(); + } + + private ArtifactDefinition buildHeatArtifact(String label, HeatParameterDefinition ... heatParameterDefinitions) { + ArtifactBuilder artifactBuilder = new ArtifactBuilder().setLabel(label); + Stream.of(heatParameterDefinitions).forEach(artifactBuilder::addHeatParam); + return artifactBuilder.build(); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBLTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBLTest.java new file mode 100644 index 0000000000..26b6782918 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/ComponentInputsMergeBLTest.java @@ -0,0 +1,94 @@ +package org.openecomp.sdc.be.components.merge.input; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.apache.commons.collections.ListUtils; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; + +import fj.data.Either; + +public class ComponentInputsMergeBLTest { + + @InjectMocks + private ComponentInputsMergeBL testInstance; + + @Mock + private InputsValuesMergingBusinessLogic inputsValuesMergingBusinessLogicMock; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergeComponentInputs() { + Resource oldResource = new ResourceBuilder() + .addInput("input1") + .addInput("input2") + .build(); + + Resource newResource = new Resource(); + + List inputsToMerge = ObjectGenerator.buildInputs("input1", "input2", "input3"); + + when(toscaOperationFacade.updateInputsToComponent(inputsToMerge, newResource.getUniqueId())).thenReturn(Either.left(inputsToMerge)); + ActionStatus actionStatus = testInstance.mergeComponentInputs(oldResource, newResource, inputsToMerge); + assertEquals(ActionStatus.OK, actionStatus); + verifyCallToMergeComponentInputs(oldResource, inputsToMerge); + } + + @SuppressWarnings("unchecked") + @Test + public void mergeAndRedeclareComponentInputs() throws Exception { + Resource oldResource = new ResourceBuilder() + .addInput("input1") + .addInput("input2") + .build(); + + Resource newResource = ObjectGenerator.buildBasicResource(); + List inputsToMerge = ObjectGenerator.buildInputs("input1", "input2", "input3"); + List inputsToRedeclare = ObjectGenerator.buildInputs("input4"); + List expectedInputsToUpdate = ListUtils.union(inputsToMerge, inputsToRedeclare); + when(inputsValuesMergingBusinessLogicMock.getPreviouslyDeclaredInputsToMerge(oldResource, newResource)).thenReturn(inputsToRedeclare); + when(toscaOperationFacade.updateInputsToComponent(expectedInputsToUpdate, newResource.getUniqueId())).thenReturn(Either.left(inputsToMerge)); + ActionStatus actionStatus = testInstance.mergeAndRedeclareComponentInputs(oldResource, newResource, inputsToMerge); + assertEquals(ActionStatus.OK, actionStatus); + } + + @Test + public void redeclareResourceInputsForInstance() throws Exception { + List oldInputs = ObjectGenerator.buildInputs("input1", "input2"); + Resource newResource = ObjectGenerator.buildBasicResource(); + List inputsToRedeclare = ObjectGenerator.buildInputs("input1"); + when(inputsValuesMergingBusinessLogicMock.getPreviouslyDeclaredInputsToMerge(oldInputs, newResource, "inst1")).thenReturn(inputsToRedeclare); + when(toscaOperationFacade.updateInputsToComponent(inputsToRedeclare, newResource.getUniqueId())).thenReturn(Either.left(inputsToRedeclare)); + ActionStatus actionStatus = testInstance.redeclareComponentInputsForInstance(oldInputs, newResource, "inst1"); + } + + private void verifyCallToMergeComponentInputs(Resource oldResource, List inputsToMerge) { + Map oldInputsByName = oldResource.getInputs().stream().collect(Collectors.toMap(InputDefinition::getName, Function.identity())); + Map inputsToMergeByName = inputsToMerge.stream().collect(Collectors.toMap(InputDefinition::getName, Function.identity())); + verify(inputsValuesMergingBusinessLogicMock).mergeComponentInputs(oldInputsByName, inputsToMergeByName); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java new file mode 100644 index 0000000000..b0124e4e44 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogicTest.java @@ -0,0 +1,186 @@ +package org.openecomp.sdc.be.components.merge.input; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.utils.MapUtil; +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; + +public class InputsValuesMergingBusinessLogicTest { + + public static final String INPUT_DEFUALT_TYPE = "string"; + public static final String INPUT1_ID = "input1"; + public static final String INPUT2_ID = "input2"; + public static final String INPUT3_ID = "input3"; + public static final String INPUT4_ID = "input4"; + private InputsValuesMergingBusinessLogic testInstance; + + @Before + public void setUp() throws Exception { + testInstance = new InputsValuesMergingBusinessLogic(); + } + + @Test + public void testMergeInputs_inputsOfDifferentType_dontCopyOldValue() throws Exception { + InputDefinition oldInput = createUserDefinedInputDefinition(INPUT1_ID, "oldVal1"); + + InputDefinition newInput = createInputDefinition(INPUT1_ID, null); + newInput.setType("int"); + + + Map updatedInputs = Collections.singletonMap(newInput.getName(), newInput); + Map oldInputs = Collections.singletonMap(oldInput.getName(), oldInput); + testInstance.mergeComponentInputs(oldInputs, updatedInputs); + + assertNull(updatedInputs.get(INPUT1_ID).getDefaultValue()); + } + + @Test + public void testMergeInputs_newInputsHaveNoValue_copyOldValues() throws Exception { + InputDefinition oldInputWithCsarDefaultValue = createInputDefinition(INPUT1_ID, "oldVal1"); + InputDefinition oldInputWithUserDefinedValue = createUserDefinedInputDefinition(INPUT2_ID, "oldVal2"); + InputDefinition oldInputNotExistOnNew = createUserDefinedInputDefinition(INPUT3_ID, null); + + InputDefinition newInput1 = createInputDefinition(INPUT1_ID, ""); + InputDefinition newInput2 = createUserDefinedInputDefinition(INPUT2_ID, null); + + Map updatedInputs = mapInputsByName(Arrays.asList(newInput1, newInput2)); + Map oldInputs = mapInputsByName(Arrays.asList(oldInputWithCsarDefaultValue, oldInputWithUserDefinedValue, oldInputNotExistOnNew)); + testInstance.mergeComponentInputs(oldInputs, updatedInputs); + + assertEquals(oldInputWithCsarDefaultValue.getDefaultValue(), updatedInputs.get(INPUT1_ID).getDefaultValue()); + assertEquals(oldInputWithUserDefinedValue.getDefaultValue(), updatedInputs.get(INPUT2_ID).getDefaultValue()); + assertNull(updatedInputs.get(INPUT3_ID)); + } + + @Test + public void testMergeInputs_newInputsHaveValue_dontOverrideNewValue() throws Exception { + InputDefinition oldInputWithCsarDefaultValue = createInputDefinition(INPUT1_ID, "oldVal1"); + InputDefinition oldInputWithUserDefinedValue = createUserDefinedInputDefinition(INPUT2_ID, "oldVal2"); + InputDefinition oldInputWithNoValue = createUserDefinedInputDefinition(INPUT3_ID, null); + + InputDefinition newInput1 = createInputDefinition(INPUT1_ID, "newVal1"); + InputDefinition newInput2 = createUserDefinedInputDefinition(INPUT2_ID, "newVal2"); + InputDefinition newInput3 = createUserDefinedInputDefinition(INPUT3_ID, "newVal3"); + InputDefinition newInput4 = createUserDefinedInputDefinition(INPUT4_ID, "newVal4"); + + Map updatedInputs = mapInputsByName(Arrays.asList(newInput1, newInput2, newInput3, newInput4)); + Map oldInputs = mapInputsByName(Arrays.asList(oldInputWithCsarDefaultValue, oldInputWithUserDefinedValue, oldInputWithNoValue)); + testInstance.mergeComponentInputs(oldInputs, updatedInputs); + + assertEquals(updatedInputs.get(INPUT1_ID).getDefaultValue(), newInput1.getDefaultValue()); + assertEquals(updatedInputs.get(INPUT2_ID).getDefaultValue(), newInput2.getDefaultValue()); + assertEquals(updatedInputs.get(INPUT3_ID).getDefaultValue(), newInput3.getDefaultValue()); + assertEquals(updatedInputs.get(INPUT4_ID).getDefaultValue(), newInput4.getDefaultValue()); + } + + @Test + public void getPrevoislyDeclaredInputsToMerge() throws Exception { + PropertyDataDefinition declaredInputProp1 = new PropertyDataDefinitionBuilder().addGetInputValue(INPUT1_ID).addGetInputValue(INPUT3_ID).setUniqueId("prevDeclaredPropId").build(); + PropertyDataDefinition declaredInputProp2 = new PropertyDataDefinitionBuilder().addGetInputValue(INPUT4_ID).setUniqueId("prevDeclaredPropId2").build(); + + Resource prevResource = new ResourceBuilder().addInput(INPUT1_ID).addInput(INPUT2_ID).addInput(INPUT3_ID).addInput(INPUT4_ID).build(); + + Resource currentResource = new ResourceBuilder() + .addInput(INPUT2_ID) + .addInstanceProperty("inst1", new ComponentInstanceProperty(declaredInputProp1)) + .addInstanceInput("inst2", new ComponentInstanceInput(declaredInputProp2)) + .build(); + + List previouslyDeclaredInputs = testInstance.getPreviouslyDeclaredInputsToMerge(prevResource, currentResource); + assertEquals(3, previouslyDeclaredInputs.size()); + + assertInput(previouslyDeclaredInputs.get(0), INPUT1_ID, declaredInputProp1.getUniqueId(), "inst1"); + assertInput(previouslyDeclaredInputs.get(1), INPUT3_ID, declaredInputProp1.getUniqueId(), "inst1"); + assertInput(previouslyDeclaredInputs.get(2), INPUT4_ID, declaredInputProp2.getUniqueId(), "inst2"); + } + + private void assertInput(InputDefinition inputDefinition, String expectedInputId, String expectedPropertyId, String expectedInstanceUniqueId) { + assertEquals(expectedInputId, inputDefinition.getUniqueId()); + assertEquals(expectedPropertyId, inputDefinition.getPropertyId()); + assertEquals(inputDefinition.getInstanceUniqueId(), expectedInstanceUniqueId); + } + + private Map mapInputsByName(List inputs) { + return MapUtil.toMap(inputs, InputDefinition::getName); + } + + private InputDefinition createInputDefinition(String name, String value) { + InputDefinition inputDef = new InputDefinition(); + inputDef.setName(name); + inputDef.setDefaultValue(value); + inputDef.setType(INPUT_DEFUALT_TYPE); + return inputDef; + } + + private InputDefinition createUserDefinedInputDefinition(String name, String value) { + InputDefinition inputDef = createInputDefinition(name, value); + inputDef.setOwnerId("owner"); + return inputDef; + } + + private void addInstanceProperty(Resource resource, ComponentInstanceProperty prop, String instanceId) { + addInstancePropDefinition(resource.getComponentInstancesProperties(), prop, instanceId); + } + + private void addInstanceInput(Resource resource, ComponentInstanceInput prop, String instanceId) { + addInstancePropDefinition(resource.getComponentInstancesInputs(), prop, instanceId); + } + + private void addInstancePropDefinition(Map> propsDefinitions, T propDef, String instanceId) { + propsDefinitions.computeIfAbsent(instanceId, id -> new ArrayList<>()).add(propDef); + } + + private Resource createResourceWithInputs(String ... inputsIds) { + Resource resource = new Resource(); + List inputs = new ArrayList<>(); + for (String inputId : inputsIds) { + InputDefinition inputDefinition = new InputDefinition(); + inputDefinition.setOwnerId("cs0008"); + inputDefinition.setUniqueId(inputId); + inputs.add(inputDefinition); + } + resource.setInputs(inputs); + return resource; + } + + + private ComponentInstanceProperty createGetInputComponentProperty(String ... declaredToInputId) { + ComponentInstanceProperty prevDeclaredProperty = new ComponentInstanceProperty(); + for (String inputId : declaredToInputId) { + addGetInputValueOnProp(inputId, prevDeclaredProperty); + } + + return prevDeclaredProperty; + } + + private void addGetInputValueOnProp(String declaredToInputId, PropertyDataDefinition declaredProperty) { + GetInputValueDataDefinition getInputDef = new GetInputValueDataDefinition(); + getInputDef.setInputId(declaredToInputId); + if (declaredProperty.getGetInputValues() == null) { + declaredProperty.setGetInputValues(new ArrayList<>()); + } + declaredProperty.getGetInputValues().add(getInputDef); + } + + private ComponentInstanceInput createGetInputComponentInstanceInput(String declaredToInputId) { + ComponentInstanceInput prevDeclaredProp = new ComponentInstanceInput(); + addGetInputValueOnProp(declaredToInputId, prevDeclaredProp); + return prevDeclaredProp; + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMergeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMergeTest.java new file mode 100644 index 0000000000..be16bc3621 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceArtifactsMergeTest.java @@ -0,0 +1,88 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import static junit.framework.TestCase.assertEquals; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; + + +public class ComponentInstanceArtifactsMergeTest { + + @InjectMocks + private ComponentInstanceArtifactsMerge testInstance; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testDeploymentArtifactSaveData() throws Exception { + + Component containerComponent = new Resource(); + Component originComponent = buildOriginalComponentWithOneArtifact(); + ComponentInstance componentInstance = buildComponentInstanceWithTwoArtifacts(); + + DataForMergeHolder dataForMergeHolder = new DataForMergeHolder(); + testInstance.saveDataBeforeMerge(dataForMergeHolder, containerComponent, componentInstance, originComponent); + Map originalComponentDeploymentArtifactsCreatedOnTheInstance = dataForMergeHolder.getOrigComponentDeploymentArtifactsCreatedOnTheInstance(); + + assertEquals(originalComponentDeploymentArtifactsCreatedOnTheInstance.size() , 1); + assert(originalComponentDeploymentArtifactsCreatedOnTheInstance.containsKey("artifactTwo")); + } + + @Test + public void testInformationalArtifactSaveData() throws Exception { + + Component containerComponent = new Resource(); + Component originComponent = buildOriginalComponentWithOneArtifact(); + ComponentInstance componentInstance = buildComponentInstanceWithTwoArtifacts(); + + DataForMergeHolder dataForMergeHolder = new DataForMergeHolder(); + testInstance.saveDataBeforeMerge(dataForMergeHolder, containerComponent, componentInstance, originComponent); + Map originalComponentInformationalArtifactsCreatedOnTheInstance = dataForMergeHolder.getOrigComponentInformationalArtifactsCreatedOnTheInstance(); + + assertEquals(originalComponentInformationalArtifactsCreatedOnTheInstance.size() , 1); + assert(originalComponentInformationalArtifactsCreatedOnTheInstance.containsKey("artifactTwo")); + } + + private ComponentInstance buildComponentInstanceWithTwoArtifacts(){ + ArtifactDefinition artifactFromTheOriginalResource = new ArtifactDefinition(); + artifactFromTheOriginalResource.setArtifactLabel("artifactOne"); + ArtifactDefinition artifactCreatedOnTheInstance = new ArtifactDefinition(); + artifactCreatedOnTheInstance.setArtifactLabel("artifactTwo"); + + Map componentInstanceArtifacts = new HashMap<>(); + componentInstanceArtifacts.put(artifactFromTheOriginalResource.getArtifactLabel(), artifactFromTheOriginalResource); + componentInstanceArtifacts.put(artifactCreatedOnTheInstance.getArtifactLabel(), artifactCreatedOnTheInstance); + + ComponentInstance componentInstance = new ComponentInstance(); + componentInstance.setDeploymentArtifacts(componentInstanceArtifacts); + componentInstance.setArtifacts(componentInstanceArtifacts); + return componentInstance; + } + + private Component buildOriginalComponentWithOneArtifact() { + ArtifactDefinition artifactFromTheOriginalResource = new ArtifactDefinition(); + artifactFromTheOriginalResource.setArtifactLabel("artifactOne"); + + Map originComponentArtifacts = new HashMap<>(); + originComponentArtifacts.put(artifactFromTheOriginalResource.getArtifactLabel(), artifactFromTheOriginalResource); + Component originComponent = new Resource(); + originComponent.setDeploymentArtifacts(originComponentArtifacts); + originComponent.setArtifacts(originComponentArtifacts); + return originComponent; + } + + + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceDataMergingTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceDataMergingTest.java new file mode 100644 index 0000000000..c9310dc1dc --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceDataMergingTest.java @@ -0,0 +1,16 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import org.junit.Test; + +/** + * Created by chaya on 9/19/2017. + */ +public class ComponentInstanceDataMergingTest { + + ComponentInstanceMergeDataBusinessLogic compInstMergeDataBL; + + @Test + public void testMergeInstanceInputs() { + //compInstMergeDataBL.mergeComponentUserOrigData(); + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMergeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMergeTest.java new file mode 100644 index 0000000000..2101ea49ab --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceHeatEnvMergeTest.java @@ -0,0 +1,101 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; +import org.openecomp.sdc.be.components.merge.heat.HeatEnvArtifactsMergeBusinessLogic; +import org.openecomp.sdc.be.components.utils.ArtifactBuilder; +import org.openecomp.sdc.be.components.utils.ComponentInstanceBuilder; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; +import org.openecomp.sdc.common.api.ArtifactTypeEnum; + +import fj.data.Either; + +public class ComponentInstanceHeatEnvMergeTest { + + @InjectMocks + private ComponentInstanceHeatEnvMerge testInstance; + + @Mock + private ArtifactsBusinessLogic artifactsBusinessLogicMock; + + @Mock + private HeatEnvArtifactsMergeBusinessLogic heatEnvArtifactsMergeBusinessLogicMock; + + @Mock + private ComponentsUtils componentsUtils; + + private static final User USER = new User(); + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergeDataAfterCreate_mergeAndPersistArtifacts() throws Exception { + Map nodeTypeArtifactsByName = buildMapOfHeatArtifacts("artifact1", "artifact2"); + DataForMergeHolder dataHolder = new DataForMergeHolder(); + dataHolder.setOrigComponentDeploymentArtifactsCreatedOnTheInstance(nodeTypeArtifactsByName); + String instanceId = "instance1"; + Resource resource = buildResourceWithHeatArtifacts(instanceId, "heatArtifact1", "heatArtifact2"); + List mergedArtifacts = buildListOfArtifacts("artifact1, heatArtifact1"); + when(heatEnvArtifactsMergeBusinessLogicMock.mergeInstanceHeatEnvArtifacts(dataHolder.getOrigComponentInstanceHeatEnvArtifacts(), resource.safeGetComponentInstanceHeatArtifacts(instanceId))) + .thenReturn(mergedArtifacts); + expectMergedArtifactsToBePersisted(mergedArtifacts, instanceId, resource); + testInstance.mergeDataAfterCreate(USER, dataHolder, resource, instanceId); + } + + private void expectMergedArtifactsToBePersisted(List mergedArtifacts, String instanceId, Resource resource) { + for (ArtifactDefinition mergedArtifact : mergedArtifacts) { + Map json = new HashMap<>(); + when(artifactsBusinessLogicMock.buildJsonForUpdateArtifact(mergedArtifact, ArtifactGroupTypeEnum.DEPLOYMENT, null)).thenReturn(json); + ArtifactsBusinessLogic.ArtifactOperationInfo artifactUpdateOperation = artifactsBusinessLogicMock.new ArtifactOperationInfo(false, false, ArtifactsBusinessLogic.ArtifactOperationEnum.Update); + when(artifactsBusinessLogicMock.updateResourceInstanceArtifactNoContent(Mockito.eq(instanceId), Mockito.eq(resource), + Mockito.eq(USER), Mockito.eq(json), + Mockito.refEq(artifactUpdateOperation), + Mockito.isNull(ArtifactDefinition.class))) + .thenReturn(Either.left(Either.left(new ArtifactDefinition()))); + } + } + + private Resource buildResourceWithHeatArtifacts(String instanceId, String ... artifacts) { + ComponentInstanceBuilder componentInstanceBuilder = new ComponentInstanceBuilder().setId(instanceId); + for (String artifact : artifacts) { + ArtifactDefinition heatArtifact = new ArtifactBuilder().setType(ArtifactTypeEnum.HEAT_ARTIFACT.getType()).setName(artifact).build(); + componentInstanceBuilder.addDeploymentArtifact(heatArtifact); + } + return new ResourceBuilder().addComponentInstance(componentInstanceBuilder.build()).build(); + } + + private Map buildMapOfHeatArtifacts(String ... artifacts) { + Map artifactsByName = new HashMap<>(); + for (String artifact : artifacts) { + ArtifactDefinition heatArtifact = new ArtifactBuilder().setType(ArtifactTypeEnum.HEAT_ARTIFACT.getType()).setName(artifact).build(); + artifactsByName.put(artifact, heatArtifact); + } + return artifactsByName; + } + + private List buildListOfArtifacts(String ... artifacts) { + return Stream.of(artifacts).map(artifact -> new ArtifactBuilder().setName(artifact).build()).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogicTest.java new file mode 100644 index 0000000000..bc3efe423d --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogicTest.java @@ -0,0 +1,115 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; + +import java.util.Arrays; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.exception.ResponseFormat; + +import fj.data.Either; + +public class ComponentInstanceMergeDataBusinessLogicTest { + + @InjectMocks + private ComponentInstanceMergeDataBusinessLogic testInstance; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Mock + private ComponentsUtils componentsUtils; + + @Mock + private ComponentInstanceMergeInterface componentInstanceMergeInterfaceMock1; + + @Mock + private ComponentInstanceMergeInterface componentInstanceMergeInterfaceMock2; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + testInstance.setComponentInstancesMergeBLs(Arrays.asList(componentInstanceMergeInterfaceMock1, componentInstanceMergeInterfaceMock2)); + } + + @Test + public void saveAllDataBeforeDeleting_allInstanceMergeInterfacesAreCalled() throws Exception { + Component container = new Service(); + ComponentInstance instance = new ComponentInstance(); + Component instanceOriginResource = new Resource(); + DataForMergeHolder dataForMergeHolder = testInstance.saveAllDataBeforeDeleting(container, instance, instanceOriginResource); + verify(componentInstanceMergeInterfaceMock1).saveDataBeforeMerge(dataForMergeHolder, container, instance, instanceOriginResource); + verify(componentInstanceMergeInterfaceMock2).saveDataBeforeMerge(dataForMergeHolder, container, instance, instanceOriginResource); + } + + @Test + public void mergeComponentUserOrigData_allInstanceMergeInterfacesAreCalled() throws Exception { + ArgumentCaptor componentsFilterCapture = ArgumentCaptor.forClass(ComponentParametersView.class); + Service persistedService = new Service(); + User user = new User(); + DataForMergeHolder dataHolder = new DataForMergeHolder(); + when(toscaOperationFacade.getToscaElement(Mockito.eq("newContainerId"), componentsFilterCapture.capture())).thenReturn(Either.left(persistedService)); + when(componentInstanceMergeInterfaceMock1.mergeDataAfterCreate(user, dataHolder, persistedService, "instId")).thenReturn(Either.left(persistedService)); + when(componentInstanceMergeInterfaceMock2.mergeDataAfterCreate(user, dataHolder, persistedService, "instId")).thenReturn(Either.left(persistedService)); + Either mergeResult = testInstance.mergeComponentUserOrigData(user, dataHolder, new Service(), "newContainerId", "instId"); + assertEquals(persistedService, mergeResult.left().value()); + assertComponentFilter(componentsFilterCapture.getValue()); + } + + @Test + public void mergeComponentUserOrigData_failToGetPersistedComponent_doNotTryToMerge() throws Exception { + User user = new User(); + DataForMergeHolder dataHolder = new DataForMergeHolder(); + ResponseFormat rf = new ResponseFormat(); + Resource container = new ResourceBuilder().setComponentType(ComponentTypeEnum.SERVICE).build(); + when(toscaOperationFacade.getToscaElement(Mockito.eq("newContainerId"), Mockito.any(ComponentParametersView.class))).thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR, ComponentTypeEnum.SERVICE)).thenReturn(ActionStatus.GENERAL_ERROR); + when(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)).thenReturn(rf); + Either mergeResult = testInstance.mergeComponentUserOrigData(user, dataHolder, container, "newContainerId", "instId"); + assertEquals(rf, mergeResult.right().value()); + verifyZeroInteractions(componentInstanceMergeInterfaceMock1, componentInstanceMergeInterfaceMock2); + } + + @Test + public void mergeComponentUserOrigData_failOnOneMerge_doNotCallOtherMerge() throws Exception { + Service persistedService = new Service(); + User user = new User(); + DataForMergeHolder dataHolder = new DataForMergeHolder(); + ResponseFormat rf = new ResponseFormat(); + when(toscaOperationFacade.getToscaElement(Mockito.eq("newContainerId"), Mockito.any(ComponentParametersView.class))).thenReturn(Either.left(persistedService)); + when(componentInstanceMergeInterfaceMock1.mergeDataAfterCreate(user, dataHolder, persistedService, "instId")).thenReturn(Either.right(rf)); + Either mergeResult = testInstance.mergeComponentUserOrigData(user, dataHolder, new Service(), "newContainerId", "instId"); + assertEquals(rf, mergeResult.right().value()); + verifyZeroInteractions(componentInstanceMergeInterfaceMock2); + } + + private void assertComponentFilter(ComponentParametersView value) { + assertFalse(value.isIgnoreComponentInstances()); + assertFalse(value.isIgnoreComponentInstancesProperties()); + assertFalse(value.isIgnoreComponentInstancesInputs()); + assertFalse(value.isIgnoreArtifacts()); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMergeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMergeTest.java new file mode 100644 index 0000000000..cb3d506bfc --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstancePropsAndInputsMergeTest.java @@ -0,0 +1,154 @@ +package org.openecomp.sdc.be.components.merge.instance; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyList; +import static org.mockito.ArgumentMatchers.anyListOf; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstanceInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstancePropertiesMergeBL; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.exception.ResponseFormat; + +import fj.data.Either; + +public class ComponentInstancePropsAndInputsMergeTest { + + private static final String INSTANCE_ID1 = "inst1"; + private static final User USER = new User(); + + @InjectMocks + private ComponentInstancePropsAndInputsMerge testInstance; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Mock + private ComponentsUtils componentsUtils; + + @Mock + private ComponentInstancePropertiesMergeBL componentInstancePropertiesMergeBL; + + @Mock + private ComponentInstanceInputsMergeBL componentInstanceInputsMergeBL; + + @Mock + private ComponentInputsMergeBL componentInputsMergeBL; + + private Resource resourceToUpdate; + + private DataForMergeHolder oldDataHolder; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + resourceToUpdate = new ResourceBuilder().addInstanceInput(INSTANCE_ID1, "instInput1") + .addInstanceInput(INSTANCE_ID1, "instInput2") + .addInstanceProperty(INSTANCE_ID1, "instProp1") + .addInstanceProperty(INSTANCE_ID1, "instProp2") + .addInput("input1") + .addInput("input2") + .setUniqueId("resourceId").build(); + + List oldInputs = ObjectGenerator.buildInputs("input1"); + List oldInstProps = ObjectGenerator.buildInstanceProperties("instProp1", "instProp3"); + List oldInstInputs = ObjectGenerator.buildInstanceInputs("instInput1", "instInput3"); + + oldDataHolder = new DataForMergeHolder(); + oldDataHolder.setOrigComponentInputs(oldInputs); + oldDataHolder.setOrigComponentInstanceProperties(oldInstProps); + oldDataHolder.setOrigComponentInstanceInputs(oldInstInputs); + } + + @Test + public void mergeDataAfterCreate() throws Exception { + List oldInputs = ObjectGenerator.buildInputs("input1"); + List oldInstProps = ObjectGenerator.buildInstanceProperties("instProp1", "instProp3"); + List oldInstInputs = ObjectGenerator.buildInstanceInputs("instInput1", "instInput3"); + + DataForMergeHolder dataForMergeHolder = new DataForMergeHolder(); + dataForMergeHolder.setOrigComponentInputs(oldInputs); + dataForMergeHolder.setOrigComponentInstanceProperties(oldInstProps); + dataForMergeHolder.setOrigComponentInstanceInputs(oldInstInputs); + + ArgumentCaptor parametersViewCaptor = ArgumentCaptor.forClass(ComponentParametersView.class); + + when(toscaOperationFacade.getToscaElement(Mockito.eq("resourceId"), parametersViewCaptor.capture())).thenReturn(Either.left(resourceToUpdate)); + when(componentInstanceInputsMergeBL.mergeComponentInstanceInputs(oldInstInputs, oldInputs, resourceToUpdate, INSTANCE_ID1)).thenReturn(ActionStatus.OK); + when(componentInstancePropertiesMergeBL.mergeComponentInstanceProperties(oldInstProps, oldInputs, resourceToUpdate, INSTANCE_ID1)).thenReturn(ActionStatus.OK); + when(componentInputsMergeBL.redeclareComponentInputsForInstance(oldInputs, resourceToUpdate, INSTANCE_ID1)).thenReturn(ActionStatus.OK); + Either mergeResult = testInstance.mergeDataAfterCreate(USER, dataForMergeHolder, resourceToUpdate, INSTANCE_ID1); + assertEquals(mergeResult.left().value(), resourceToUpdate); + assertComponentFilter(parametersViewCaptor.getValue()); + } + + @Test + public void mergeDataAfterCreate_failedToMergeComponentInstanceInputs() throws Exception { + ResponseFormat errorResponse = new ResponseFormat(); + when(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)).thenReturn(errorResponse); + when(componentInstanceInputsMergeBL.mergeComponentInstanceInputs(anyListOf(ComponentInstanceInput.class), anyListOf(InputDefinition.class), any(Component.class), anyString())).thenReturn(ActionStatus.GENERAL_ERROR); + Either mergeResult = testInstance.mergeDataAfterCreate(USER, new DataForMergeHolder(), new Service(), "inst1"); + assertEquals(errorResponse, mergeResult.right().value()); + verifyZeroInteractions(componentInputsMergeBL, componentInstancePropertiesMergeBL, toscaOperationFacade); + } + + @Test + public void mergeDataAfterCreate_failedToMergeComponentInstProps() throws Exception { + ResponseFormat errorResponse = new ResponseFormat(); + when(componentInstanceInputsMergeBL.mergeComponentInstanceInputs(anyList(), anyList(), any(Component.class), anyString())).thenReturn(ActionStatus.OK); + when(componentInstancePropertiesMergeBL.mergeComponentInstanceProperties(anyList(), anyList(), any(Component.class), anyString())).thenReturn(ActionStatus.GENERAL_ERROR); + when(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)).thenReturn(errorResponse); + Either mergeResult = testInstance.mergeDataAfterCreate(USER, new DataForMergeHolder(), new Service(), "inst1"); + assertEquals(errorResponse, mergeResult.right().value()); + verifyZeroInteractions(componentInputsMergeBL, toscaOperationFacade); + } + + @Test + public void mergeDataAfterCreate_mergeInputs_FailedToFetchResource() throws Exception { + ResponseFormat errorResponse = new ResponseFormat(); + when(componentInstanceInputsMergeBL.mergeComponentInstanceInputs(anyList(), anyList(), any(Component.class), anyString())).thenReturn(ActionStatus.OK); + when(componentInstancePropertiesMergeBL.mergeComponentInstanceProperties(anyList(), anyList(), any(Component.class), anyString())).thenReturn(ActionStatus.OK); + when(toscaOperationFacade.getToscaElement(any(), any(ComponentParametersView.class))).thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + when(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR)).thenReturn(errorResponse); + DataForMergeHolder dataHolder = new DataForMergeHolder(); + dataHolder.setOrigComponentInputs(ObjectGenerator.buildInputs("input1", "input2")); + Either mergeResult = testInstance.mergeDataAfterCreate(USER, dataHolder, new Service(), "inst1"); + assertEquals(errorResponse, mergeResult.right().value()); + verifyZeroInteractions(componentInputsMergeBL); + } + + private void assertComponentFilter(ComponentParametersView value) { + assertFalse(value.isIgnoreComponentInstances()); + assertFalse(value.isIgnoreComponentInstancesProperties()); + assertFalse(value.isIgnoreComponentInstancesInputs()); + assertFalse(value.isIgnoreArtifacts()); + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBLTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBLTest.java new file mode 100644 index 0000000000..0a858c9a29 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstanceInputsMergeBLTest.java @@ -0,0 +1,120 @@ +package org.openecomp.sdc.be.components.merge.property; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.util.Collections; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ComponentInstanceBuilder; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +public class ComponentInstanceInputsMergeBLTest { + + public static final String INSTANCE1 = "instance1"; + public static final String INSTANCE2 = "instance2"; + @InjectMocks + private ComponentInstanceInputsMergeBL testInstance; + + @Mock + private DataDefinitionsValuesMergingBusinessLogic propertyValuesMergingBusinessLogic; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Mock + private ComponentsUtils componentsUtils; + + private Resource oldResource, newResource; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + ComponentInstance instance1 = new ComponentInstanceBuilder().setId(INSTANCE1).setName(INSTANCE1).build(); + ComponentInstance instance2 = new ComponentInstanceBuilder().setId(INSTANCE2).setName(INSTANCE2).build(); + + oldResource = new ResourceBuilder() + .addInstanceInput(INSTANCE1, "property1") + .addInstanceInput(INSTANCE1, "property2") + .addInstanceInput(INSTANCE2, "property3") + .addComponentInstance(instance1) + .addComponentInstance(instance2) + .addInput("input1") + .addInput("input2").build(); + + newResource = new ResourceBuilder() + .addInstanceInput(INSTANCE1, "property11") + .addInstanceInput(INSTANCE1, "property12") + .addInstanceInput(INSTANCE2, "property13") + .addComponentInstance(instance1) + .addComponentInstance(instance2) + .addInput("input11") + .addInput("input12").build(); + } + + @Test + public void mergeInstancesInputs() throws Exception { + when(toscaOperationFacade.updateComponentInstanceInputsToComponent(newResource.getComponentInstancesInputs(), newResource.getUniqueId())).thenReturn(Either.left(Collections.emptyMap())); + ActionStatus actionStatus = testInstance.mergeComponentInstancesInputs(oldResource, newResource); + assertEquals(actionStatus, ActionStatus.OK); + verifyMergeBLCalled(oldResource, newResource); + } + + @Test + public void mergeInstancesInputs_failure() throws Exception { + when(toscaOperationFacade.updateComponentInstanceInputsToComponent(newResource.getComponentInstancesInputs(), newResource.getUniqueId())).thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + verifyNoMoreInteractions(toscaOperationFacade, propertyValuesMergingBusinessLogic); + ActionStatus actionStatus = testInstance.mergeComponentInstancesInputs(oldResource, newResource); + assertEquals(ActionStatus.GENERAL_ERROR, actionStatus); + } + + @Test + public void mergeInstanceProps() throws Exception { + List newInstanceInputs = newResource.safeGetComponentInstanceInput(INSTANCE1); + List oldInstInputs = oldResource.safeGetComponentInstanceInput(INSTANCE1); + when(toscaOperationFacade.updateComponentInstanceInputs(newResource, INSTANCE1, newInstanceInputs)) + .thenReturn(StorageOperationStatus.OK); + ActionStatus actionStatus = testInstance.mergeComponentInstanceInputs(oldInstInputs, oldResource.getInputs(), newResource, INSTANCE1); + assertEquals(actionStatus, ActionStatus.OK); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(oldInstInputs, oldResource.getInputs(), newInstanceInputs, newResource.getInputs()); + } + + @Test + public void mergeInstanceProps_failure() throws Exception { + List newInstanceInputs = newResource.safeGetComponentInstanceInput(INSTANCE1); + List oldInstInputs = oldResource.safeGetComponentInstanceInput(INSTANCE1); + when(toscaOperationFacade.updateComponentInstanceInputs(newResource, INSTANCE1, newInstanceInputs)) + .thenReturn(StorageOperationStatus.GENERAL_ERROR); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + ActionStatus actionStatus = testInstance.mergeComponentInstanceInputs(oldInstInputs, oldResource.getInputs(), newResource, INSTANCE1); + assertEquals(actionStatus, ActionStatus.GENERAL_ERROR); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(oldInstInputs, oldResource.getInputs(), newInstanceInputs, newResource.getInputs()); + } + + private void verifyMergeBLCalled(Resource oldResource, Resource newResource) { + List instance1oldInputs = oldResource.getComponentInstancesInputs().get(INSTANCE1); + List instance1newInputs = newResource.getComponentInstancesInputs().get(INSTANCE1); + List instance2oldInputs = oldResource.getComponentInstancesInputs().get(INSTANCE2); + List instance2newInputs = newResource.getComponentInstancesInputs().get(INSTANCE2); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(instance1oldInputs, oldResource.getInputs(), instance1newInputs, newResource.getInputs()); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(instance2oldInputs, oldResource.getInputs(), instance2newInputs, newResource.getInputs()); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBLTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBLTest.java new file mode 100644 index 0000000000..7948ab8a3d --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/ComponentInstancePropertiesMergeBLTest.java @@ -0,0 +1,114 @@ +package org.openecomp.sdc.be.components.merge.property; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.util.Collections; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.ResourceBuilder; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import fj.data.Either; + +public class ComponentInstancePropertiesMergeBLTest { + + private static final String INSTANCE1 = "instance1"; + private static final String INSTANCE2 = "instance2"; + + @InjectMocks + private ComponentInstancePropertiesMergeBL testInstance; + + @Mock + private DataDefinitionsValuesMergingBusinessLogic propertyValuesMergingBusinessLogic; + + @Mock + private ToscaOperationFacade toscaOperationFacade; + + @Mock + private ComponentsUtils componentsUtils; + + private Resource oldResource, newResource; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + oldResource = new ResourceBuilder() + .addInstanceProperty(INSTANCE1, "property1") + .addInstanceProperty(INSTANCE1, "property2") + .addInstanceProperty(INSTANCE2, "property3") + .addInput("input1") + .addInput("input2").build(); + + newResource = new ResourceBuilder() + .addInstanceProperty(INSTANCE1, "property11") + .addInstanceProperty(INSTANCE1, "property12") + .addInstanceProperty(INSTANCE2, "property13") + .addInput("input11") + .addInput("input12").build(); + } + + @Test + public void mergeInstancesPropsAndInputs_mergeInstanceProps() throws Exception { + when(toscaOperationFacade.updateComponentInstancePropsToComponent(newResource.getComponentInstancesProperties(), newResource.getUniqueId())) + .thenReturn(Either.left(Collections.emptyMap())); + ActionStatus actionStatus = testInstance.mergeComponentInstancesProperties(oldResource, newResource); + assertEquals(actionStatus, ActionStatus.OK); + verifyMergeBLCalled(oldResource, newResource); + } + + @Test + public void mergeInstancesProps_failure() throws Exception { + when(toscaOperationFacade.updateComponentInstancePropsToComponent(newResource.getComponentInstancesProperties(), newResource.getUniqueId())) + .thenReturn(Either.right(StorageOperationStatus.GENERAL_ERROR)); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + verifyNoMoreInteractions(toscaOperationFacade, propertyValuesMergingBusinessLogic); + ActionStatus actionStatus = testInstance.mergeComponentInstancesProperties(oldResource, newResource); + assertEquals(ActionStatus.GENERAL_ERROR, actionStatus); + } + + @Test + public void mergeInstanceProps() throws Exception { + List newInstanceProps = newResource.safeGetComponentInstanceProperties(INSTANCE1); + List oldInstProps = oldResource.safeGetComponentInstanceProperties(INSTANCE1); + when(toscaOperationFacade.updateComponentInstanceProperties(newResource, INSTANCE1, newInstanceProps)) + .thenReturn(StorageOperationStatus.OK); + ActionStatus actionStatus = testInstance.mergeComponentInstanceProperties(oldInstProps, oldResource.getInputs(), newResource, INSTANCE1); + assertEquals(actionStatus, ActionStatus.OK); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(oldInstProps, oldResource.getInputs(), newInstanceProps, newResource.getInputs()); + } + + @Test + public void mergeInstanceProps_failure() throws Exception { + List newInstanceProps = newResource.safeGetComponentInstanceProperties(INSTANCE1); + List oldInstProps = oldResource.safeGetComponentInstanceProperties(INSTANCE1); + when(toscaOperationFacade.updateComponentInstanceProperties(newResource, INSTANCE1, newInstanceProps)) + .thenReturn(StorageOperationStatus.GENERAL_ERROR); + when(componentsUtils.convertFromStorageResponse(StorageOperationStatus.GENERAL_ERROR)).thenReturn(ActionStatus.GENERAL_ERROR); + ActionStatus actionStatus = testInstance.mergeComponentInstanceProperties(oldInstProps, oldResource.getInputs(), newResource, INSTANCE1); + assertEquals(actionStatus, ActionStatus.GENERAL_ERROR); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(oldInstProps, oldResource.getInputs(), newInstanceProps, newResource.getInputs()); + } + + private void verifyMergeBLCalled(Resource oldResource, Resource newResource) { + List instance1oldProps = oldResource.getComponentInstancesProperties().get(INSTANCE1); + List instance1newProps = newResource.getComponentInstancesProperties().get(INSTANCE1); + List instance2oldProps = oldResource.getComponentInstancesProperties().get(INSTANCE2); + List instance2newProps = newResource.getComponentInstancesProperties().get(INSTANCE2); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(instance1oldProps, oldResource.getInputs(), instance1newProps, newResource.getInputs()); + verify(propertyValuesMergingBusinessLogic).mergeInstanceDataDefinitions(instance2oldProps, oldResource.getInputs(), instance2newProps, newResource.getInputs()); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogicTest.java new file mode 100644 index 0000000000..8669a781b4 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/DataDefinitionsValuesMergingBusinessLogicTest.java @@ -0,0 +1,122 @@ +package org.openecomp.sdc.be.components.merge.property; + +import static org.mockito.Mockito.verify; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.InputDefinition; + +public class DataDefinitionsValuesMergingBusinessLogicTest { + + private static final String DEFAULT_PROP_TYPE = "string"; + + @InjectMocks + private DataDefinitionsValuesMergingBusinessLogic testInstance; + + @Mock + private PropertyDataValueMergeBusinessLogic propertyDataValueMergeBusinessLogicMock; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergePropDataDefinition_propertiesNotOfSameType_dontMerge() throws Exception { + PropertyDataDefinition oldProp1 = createPropertyDataDefinition("prop1", "oldVal1"); + + PropertyDataDefinition newProp1 = createPropertyDataDefinition("prop1", null); + newProp1.setType("int"); + + testInstance.mergeInstanceDataDefinitions(Collections.singletonList(oldProp1), Collections.emptyList(), Collections.singletonList(newProp1), Collections.emptyList()); + Mockito.verifyZeroInteractions(propertyDataValueMergeBusinessLogicMock); + } + + @Test + public void mergePropDataDefinition_propertiesInnerTypesNotSame_dontMerge() throws Exception { + PropertyDataDefinition oldProp1 = new PropertyDataDefinitionBuilder() + .setName("prop1") + .setType("list") + .setSchemaType("string") + .setValue("val1").build(); + + PropertyDataDefinition newProp1 = new PropertyDataDefinitionBuilder() + .setName("prop1") + .setType("list") + .setSchemaType("int") + .setValue("val1").build(); + + testInstance.mergeInstanceDataDefinitions(Collections.singletonList(oldProp1), Collections.emptyList(), Collections.singletonList(newProp1), Collections.emptyList()); + Mockito.verifyZeroInteractions(propertyDataValueMergeBusinessLogicMock); + } + + @Test + public void mergePropDataDefinition_getInputsToMerge_mergeInputsThatExistInNewVersion_mergeInputsThatDeclaredByUserInPrevVersion() throws Exception { + PropertyDataDefinition userDeclaredGetInput = createGetInputPropertyDataDefinition("prop1", "input1"); + PropertyDataDefinition nonUserDeclaredGetInput = createGetInputPropertyDataDefinition("prop2", "input2", "input3"); + + PropertyDataDefinition newProp1 = createPropertyDataDefinition("prop1", ""); + PropertyDataDefinition newProp2 = createPropertyDataDefinition("prop2", null); + + InputDefinition oldDeclaredByUserInput1 = new InputDefinition(); + oldDeclaredByUserInput1.setName("input1"); + oldDeclaredByUserInput1.setInstanceUniqueId("instanceId"); + + InputDefinition oldNotDeclaredByUserInput2 = new InputDefinition(); + oldNotDeclaredByUserInput2.setName("input2"); + + InputDefinition oldNotDeclaredByUserInput3 = new InputDefinition(); + oldNotDeclaredByUserInput3.setName("input3"); + + InputDefinition newInput3 = new InputDefinition(); + newInput3.setName("input3"); + + List oldProps = Arrays.asList(userDeclaredGetInput, nonUserDeclaredGetInput); + List newProps = Arrays.asList(newProp1, newProp2); + + List oldInputs = Arrays.asList(oldDeclaredByUserInput1, oldNotDeclaredByUserInput2, oldNotDeclaredByUserInput3); + List newInputs = Collections.singletonList(newInput3); + + testInstance.mergeInstanceDataDefinitions(oldProps, oldInputs, newProps, newInputs); + //get input prop was declared by user - ok to merge it although its input not exist (it will be added later) + verify(propertyDataValueMergeBusinessLogicMock).mergePropertyValue(userDeclaredGetInput, newProp1, Collections.singletonList("input1")); + //input 2 not exist in new version - dont merge it, input 3 exist in new version - ok to merge it + verify(propertyDataValueMergeBusinessLogicMock).mergePropertyValue(nonUserDeclaredGetInput, newProp2, Collections.singletonList("input3")); + } + + @Test + public void mergePropDataDefinition_dontMergeOldPropsIfNotExistInNewVersion() throws Exception { + PropertyDataDefinition oldProp = createPropertyDataDefinition("prop1", "oldVal1"); + PropertyDataDefinition newProp = createPropertyDataDefinition("prop2", null); + testInstance.mergeInstanceDataDefinitions(Collections.singletonList(oldProp), Collections.emptyList(), Collections.singletonList(newProp), Collections.emptyList()); + Mockito.verifyZeroInteractions(propertyDataValueMergeBusinessLogicMock); + } + + private PropertyDataDefinition createPropertyDataDefinition(String name, String value) { + return new PropertyDataDefinitionBuilder() + .setName(name) + .setType(DEFAULT_PROP_TYPE) + .setValue(value).build(); + } + + private PropertyDataDefinition createGetInputPropertyDataDefinition(String name, String ... inputsNames) { + PropertyDataDefinitionBuilder propertyBuilder = new PropertyDataDefinitionBuilder() + .setName(name) + .setType(DEFAULT_PROP_TYPE); + for (String inputName : inputsNames) { + propertyBuilder.addGetInputValue(inputName); + } + return propertyBuilder.build(); + } + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java new file mode 100644 index 0000000000..6faee487f4 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/property/PropertyDataValueMergeBusinessLogicTest.java @@ -0,0 +1,253 @@ +package org.openecomp.sdc.be.components.merge.property; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder; +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; +import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; + +import fj.data.Either; + +public class PropertyDataValueMergeBusinessLogicTest { + + @InjectMocks + private PropertyDataValueMergeBusinessLogic testInstance; + + @Mock + private ApplicationDataTypeCache applicationDataTypeCache; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergeProperties_emptyOldAndNewValues() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, null); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, null); + testMergeProps(oldProp, newProp, null); + } + + @Test + public void mergeProperties_emptyOldValue() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, null); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, "newVal"); + testMergeProps(oldProp, newProp, "newVal"); + } + + @Test + public void mergeSimpleStringType_copyOldValueIfNoNewValue() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, "val1"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, null); + testMergeProps(oldProp, newProp, "val1"); + } + + @Test + public void mergeSimpleStringType_dontCopyOldValIfHasNewVal() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, "val1"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, "newVal"); + testMergeProps(oldProp, newProp, "newVal"); + } + + @Test + public void mergeSimpleIntType_copyOldValueIfNoNewValue() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.INTEGER.getType(), null, "44"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, null); + testMergeProps(oldProp, newProp, "44"); + } + + @Test + public void mergeSimpleIntType_dontCopyOldValIfHasNewVal() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.INTEGER.getType(), null, "44"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.STRING.getType(), null, "45"); + testMergeProps(oldProp, newProp, "45"); + } + + @Test + public void mergeSimpleBooleanType_copyOldValueIfNoNewValue() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.BOOLEAN.getType(), null, "false"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.BOOLEAN.getType(), null, null); + testMergeProps(oldProp, newProp, "false"); + } + + @Test + public void mergeSimpleBooleanType_dontCopyOldValIfHasNewVal() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.BOOLEAN.getType(), null, "false"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.BOOLEAN.getType(), null, "true"); + testMergeProps(oldProp, newProp, "true"); + } + + @Test + public void mergeSimpleListType_copyOldValuesByIndex() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.LIST.getType(), "string", "[\"a\", \"b\", \"c\"]"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.LIST.getType(), "string", "[\"x\", \"\"]"); + testMergeProps(oldProp, newProp, "[\"x\",\"b\",\"c\"]"); + } + + @Test + public void mergeSimpleListType_jsonList() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", ToscaPropertyType.LIST.getType(), "json", "[[\"a\", \"b\"], \"c\"]"); + PropertyDataDefinition newProp = createProp("prop1", ToscaPropertyType.LIST.getType(), "json", "[[\"a\"], \"\"]"); + testMergeProps(oldProp, newProp, "[[\"a\"],\"c\"]"); + } + + @Test + public void mergeComplexType() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", "myType", null, "{\"mac_range_plan\":\"y\", \"mac_count_required\":{\"is_required\":true,\"count\":44}}"); + PropertyDataDefinition newProp = createProp("prop1", "myType", null, "{\"mac_count_required\":{\"is_required\":false, \"mac_address\":\"myAddress\"}}"); + testMergeProps(oldProp, newProp, "{\"mac_range_plan\":\"y\",\"mac_count_required\":{\"is_required\":false,\"mac_address\":\"myAddress\",\"count\":44}}"); + } + + @Test + public void mergeListOfComplexType() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", "list", "myType", "[{\"prop1\":\"val1\", \"prop2\":{\"prop3\":true,\"prop4\":44}}, " + + "{\"prop1\":\"val2\", \"prop2\":{\"prop3\":true}}]"); + PropertyDataDefinition newProp = createProp("prop1", "list", "myType", "[{\"prop2\":{\"prop3\":false}}]"); + + Map dataTypes = buildDataTypes(); + when(applicationDataTypeCache.getAll()).thenReturn(Either.left(dataTypes)); + testInstance.mergePropertyValue(oldProp, newProp, Collections.emptyList()); + String expectedValue = "[{\"prop2\":{\"prop4\":44,\"prop3\":false},\"prop1\":\"\\\"val1\\\"\"}," + + "{\"prop2\":{\"prop3\":true},\"prop1\":\"\\\"val2\\\"\"}]"; + + assertEquals(expectedValue, newProp.getValue()); + } + + @Test + public void mergeMapType() throws Exception { + PropertyDataDefinition oldProp = createProp("prop1", "map", "string", "{\"prop1\":\"val1\", \"prop2\":\"val2\", \"prop3\":\"val3\"}"); + PropertyDataDefinition newProp = createProp("prop1", "map", "string", "{\"prop1\":\"newVal1\", \"prop2\":\"\"}"); + testMergeProps(oldProp, newProp, "{\"prop2\":\"val2\",\"prop1\":\"newVal1\",\"prop3\":\"val3\"}"); + } + + @Test + public void mergeGetInputValue() throws Exception { + PropertyDataDefinition oldProp = createGetInputProp("prop1", "string", null, "input1"); + PropertyDataDefinition newProp = createProp("prop1", "string", null, null); + testMergeProps(oldProp, newProp, oldProp.getValue(), Collections.singletonList("input1")); + assertGetInputValues(newProp, "input1"); + } + + @Test + public void mergeGetInputValue_inputNotForMerging() throws Exception { + PropertyDataDefinition oldProp = createGetInputProp("prop1", "string", null, "input1"); + PropertyDataDefinition newProp = createProp("prop1", "string", null, null); + testMergeProps(oldProp, newProp,null, Collections.singletonList("input2")); + assertTrue(newProp.getGetInputValues().isEmpty()); + } + + @Test + public void mergeComplexGetInputValue_moreThanOneGetInput_copyOnlyInputsForMerging() throws Exception { + PropertyDataDefinition oldProp = new PropertyDataDefinitionBuilder().addGetInputValue("input1").addGetInputValue("input2").setName("prop1").setType("myType").setValue("{\"mac_range_plan\":{\"get_input\": \"input1\"}, \"mac_count_required\":{\"is_required\":true,\"count\":{\"get_input\": \"input2\"}}}").build(); + PropertyDataDefinition newProp = createProp("prop1", "myType", null, "{\"mac_count_required\":{\"is_required\":true}}"); + testMergeProps(oldProp, newProp,"{\"mac_range_plan\":{},\"mac_count_required\":{\"is_required\":true,\"count\":{\"get_input\":\"input2\"}}}", Collections.singletonList("input2")); + assertGetInputValues(newProp, "input2"); + } + + @Test + public void mergeListValueWithMultipleGetInputs() throws Exception { + PropertyDataDefinition oldProp = new PropertyDataDefinitionBuilder() + .addGetInputValue("input1").addGetInputValue("input2").addGetInputValue("input3") + .setName("prop1") + .setType("list").setSchemaType("string") + .setValue("[{\"get_input\": \"input2\"},{\"get_input\": \"input3\"},{\"get_input\": \"input1\"}]") + .build(); + + PropertyDataDefinition newProp = new PropertyDataDefinitionBuilder() + .addGetInputValue("input3") + .setName("prop1") + .setType("list").setSchemaType("string") + .setValue("[\"\", {\"get_input\": \"input3\"}]") + .build(); + + testMergeProps(oldProp, newProp,"[{},{\"get_input\":\"input3\"},{\"get_input\":\"input1\"}]", Arrays.asList("input3", "input1")); + assertGetInputValues(newProp, "input3", "input1"); + } + + private void assertGetInputValues(PropertyDataDefinition newProp, String ... expectedInputNames) { + assertTrue(newProp.isGetInputProperty()); + assertEquals(newProp.getGetInputValues().size(), expectedInputNames.length); + for (int i = 0; i < expectedInputNames.length; i++) { + String expectedInputName = expectedInputNames[i]; + GetInputValueDataDefinition getInputValueDataDefinition = newProp.getGetInputValues().get(i); + assertEquals(getInputValueDataDefinition.getInputName(), expectedInputName); + } + } + + private void testMergeProps(PropertyDataDefinition oldProp, PropertyDataDefinition newProp, String expectedValue) { + testMergeProps(oldProp, newProp, expectedValue, Collections.emptyList()); + } + + private void testMergeProps(PropertyDataDefinition oldProp, PropertyDataDefinition newProp, String expectedValue, List getInputsToMerge) { + when(applicationDataTypeCache.getAll()).thenReturn(Either.left(Collections.emptyMap())); + testInstance.mergePropertyValue(oldProp, newProp, getInputsToMerge); + assertEquals(expectedValue, newProp.getValue()); + } + + private PropertyDataDefinition createProp(String name, String type, String innerType, String val) { + return new PropertyDataDefinitionBuilder() + .setType(type) + .setSchemaType(innerType) + .setValue(val) + .setName(name) + .build(); + } + + private PropertyDataDefinition createGetInputProp(String name, String type, String innerType, String inputName) { + String val = String.format("{\"get_input\":\"%s\"}", inputName); + return new PropertyDataDefinitionBuilder() + .setType(type) + .setSchemaType(innerType) + .setValue(val) + .addGetInputValue(inputName) + .setName(name) + .build(); + + } + + private Map buildDataTypes() { + DataTypeDefinition myType = new DataTypeDefinition(); + myType.setName("myType"); + DataTypeDefinition myInnerType = new DataTypeDefinition(); + myInnerType.setName("myInnerType"); + + PropertyDefinition prop1 = new PropertyDefinition(); + prop1.setName("prop1"); + + PropertyDefinition prop2 = new PropertyDefinition(); + prop2.setName("prop2"); + prop2.setType("myInnerType"); + + PropertyDefinition prop3 = new PropertyDefinition(); + prop3.setName("prop3"); + + PropertyDefinition prop4 = new PropertyDefinition(); + prop4.setName("prop4"); + + myType.setProperties(Arrays.asList(prop1, prop2)); + myInnerType.setProperties(Arrays.asList(prop3, prop4)); + + return Stream.of(myType, myInnerType).collect(Collectors.toMap(DataTypeDefinition::getName, Function.identity())); + } + + +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogicTest.java new file mode 100644 index 0000000000..8e7949f108 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/merge/resource/ResourceDataMergeBusinessLogicTest.java @@ -0,0 +1,82 @@ +package org.openecomp.sdc.be.components.merge.resource; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; + +import java.util.Collections; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.be.components.merge.input.ComponentInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstanceInputsMergeBL; +import org.openecomp.sdc.be.components.merge.property.ComponentInstancePropertiesMergeBL; +import org.openecomp.sdc.be.components.utils.ObjectGenerator; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.model.Resource; + +public class ResourceDataMergeBusinessLogicTest { + + @InjectMocks + private ResourceDataMergeBusinessLogic testInstance; + + @Mock + private ComponentInstanceInputsMergeBL instanceInputsValueMergeBLMock; + + @Mock + private ComponentInstancePropertiesMergeBL instancePropertiesValueMergeBLMock; + + @Mock + private ComponentInputsMergeBL inputsValueMergeBLMock; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + public void mergeResourceInputs_allMergeClassesAreCalled() throws Exception { + Resource oldResource = ObjectGenerator.buildBasicResource(); + Resource newResource = ObjectGenerator.buildBasicResource(); + when(instancePropertiesValueMergeBLMock.mergeComponentInstancesProperties(oldResource, newResource)).thenReturn(ActionStatus.OK); + when(instanceInputsValueMergeBLMock.mergeComponentInstancesInputs(oldResource, newResource)).thenReturn(ActionStatus.OK); + when(inputsValueMergeBLMock.mergeAndRedeclareComponentInputs(oldResource, newResource, Collections.emptyList())).thenReturn(ActionStatus.OK); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(ActionStatus.OK, actionStatus); + } + + @Test + public void mergeResourceInputs_failToMergeProperties_dontCallOtherMergeMethods() throws Exception { + Resource oldResource = ObjectGenerator.buildBasicResource(); + Resource newResource = ObjectGenerator.buildBasicResource(); + when(instancePropertiesValueMergeBLMock.mergeComponentInstancesProperties(oldResource, newResource)).thenReturn(ActionStatus.GENERAL_ERROR); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(ActionStatus.GENERAL_ERROR, actionStatus); + verifyZeroInteractions(instanceInputsValueMergeBLMock, inputsValueMergeBLMock); + } + + @Test + public void mergeResourceInputs_failToMergeInstanceInputs_dontCallOtherMergeMethods() throws Exception { + Resource oldResource = ObjectGenerator.buildBasicResource(); + Resource newResource = ObjectGenerator.buildBasicResource(); + when(instancePropertiesValueMergeBLMock.mergeComponentInstancesProperties(oldResource, newResource)).thenReturn(ActionStatus.OK); + when(instanceInputsValueMergeBLMock.mergeComponentInstancesInputs(oldResource, newResource)).thenReturn(ActionStatus.GENERAL_ERROR); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(ActionStatus.GENERAL_ERROR, actionStatus); + verifyZeroInteractions(inputsValueMergeBLMock); + } + + @Test + public void mergeResourceInputs_failedToMergeInputs() throws Exception { + Resource oldResource = ObjectGenerator.buildBasicResource(); + Resource newResource = ObjectGenerator.buildBasicResource(); + when(instancePropertiesValueMergeBLMock.mergeComponentInstancesProperties(oldResource, newResource)).thenReturn(ActionStatus.OK); + when(instanceInputsValueMergeBLMock.mergeComponentInstancesInputs(oldResource, newResource)).thenReturn(ActionStatus.OK); + when(inputsValueMergeBLMock.mergeAndRedeclareComponentInputs(oldResource, newResource, Collections.emptyList())).thenReturn(ActionStatus.GENERAL_ERROR); + ActionStatus actionStatus = testInstance.mergeResourceEntities(oldResource, newResource); + assertEquals(ActionStatus.GENERAL_ERROR, actionStatus); + } +} \ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ArtifactBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ArtifactBuilder.java new file mode 100644 index 0000000000..55a119e078 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ArtifactBuilder.java @@ -0,0 +1,42 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.ArrayList; + +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.HeatParameterDefinition; + +public class ArtifactBuilder { + + private ArtifactDefinition artifactDefinition; + + public ArtifactBuilder() { + this.artifactDefinition = new ArtifactDefinition(); + } + + public ArtifactBuilder setType(String type) { + this.artifactDefinition.setArtifactType(type); + return this; + } + + public ArtifactBuilder setName(String name) { + this.artifactDefinition.setArtifactName(name); + return this; + } + + public ArtifactBuilder setLabel(String label) { + this.artifactDefinition.setArtifactLabel(label); + return this; + } + + public ArtifactBuilder addHeatParam(HeatParameterDefinition heatParam) { + if (this.artifactDefinition.getHeatParameters() == null) { + this.artifactDefinition.setHeatParameters(new ArrayList<>()); + } + this.artifactDefinition.getHeatParameters().add(heatParam); + return this; + } + + public ArtifactDefinition build() { + return artifactDefinition; + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentInstanceBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentInstanceBuilder.java new file mode 100644 index 0000000000..a99f08c20d --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ComponentInstanceBuilder.java @@ -0,0 +1,49 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.HashMap; +import java.util.Map; + +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.ComponentInstance; + +public class ComponentInstanceBuilder { + + private ComponentInstance componentInstance; + + public ComponentInstanceBuilder() { + componentInstance = new ComponentInstance(); + } + + public ComponentInstanceBuilder setName(String name) { + componentInstance.setName(name); + return this; + } + + public ComponentInstanceBuilder setComponentUid(String componentUid) { + componentInstance.setComponentUid(componentUid); + return this; + } + + public ComponentInstanceBuilder setId(String id) { + componentInstance.setUniqueId(id); + return this; + } + + public ComponentInstanceBuilder setToscaName(String toscaName) { + componentInstance.setToscaComponentName(toscaName); + return this; + } + + public ComponentInstanceBuilder addDeploymentArtifact(ArtifactDefinition artifactDefinition) { + Map deploymentArtifacts = componentInstance.getDeploymentArtifacts(); + if (deploymentArtifacts == null) { + componentInstance.setDeploymentArtifacts(new HashMap<>()); + } + componentInstance.getDeploymentArtifacts().put(artifactDefinition.getArtifactName(), artifactDefinition); + return this; + } + + public ComponentInstance build() { + return componentInstance; + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/HeatParameterBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/HeatParameterBuilder.java new file mode 100644 index 0000000000..d32dc65876 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/HeatParameterBuilder.java @@ -0,0 +1,36 @@ +package org.openecomp.sdc.be.components.utils; + +import org.openecomp.sdc.be.model.HeatParameterDefinition; + +public class HeatParameterBuilder { + + private HeatParameterDefinition heatParameterDefinition; + + public HeatParameterBuilder() { + heatParameterDefinition = new HeatParameterDefinition(); + } + + public HeatParameterBuilder setName(String name) { + heatParameterDefinition.setName(name); + return this; + } + + public HeatParameterBuilder setType(String type) { + heatParameterDefinition.setType(type); + return this; + } + + public HeatParameterBuilder setCurrentValue(String value) { + heatParameterDefinition.setCurrentValue(value); + return this; + } + + public HeatParameterBuilder setDefaultValue(String value) { + heatParameterDefinition.setDefaultValue(value); + return this; + } + + public HeatParameterDefinition build() { + return heatParameterDefinition; + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ObjectGenerator.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ObjectGenerator.java new file mode 100644 index 0000000000..3a99d54ffa --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ObjectGenerator.java @@ -0,0 +1,101 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.HeatParameterDefinition; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.Resource; + +public class ObjectGenerator { + + public static Resource buildResourceWithInputs(String ... inputNames) { + Resource resource = buildBasicResource(); + resource.setInputs(ObjectGenerator.buildInputs(inputNames)); + return resource; + } + + public static Resource buildResourceWithProperties(String ... propertiesNames) { + ResourceBuilder resourceBuilder = new ResourceBuilder(); + resourceBuilder.setUniqueId("id"); + for (String propertyName : propertiesNames) { + PropertyDefinition propertyDefinition = new PropertyDefinition(); + propertyDefinition.setName(propertyName); + resourceBuilder.addProperty(propertyDefinition); + } + return resourceBuilder.build(); + } + + public static List buildInstanceProperties(String ... propertiesNames) { + return Stream.of(propertiesNames).map(name -> { + ComponentInstanceProperty instProp = new ComponentInstanceProperty(); + instProp.setName(name); + return instProp; + }).collect(Collectors.toList()); + } + + public static List buildInstanceInputs(String ... inputsNames) { + return Stream.of(inputsNames).map(name -> { + ComponentInstanceInput instProp = new ComponentInstanceInput(); + instProp.setName(name); + return instProp; + }).collect(Collectors.toList()); + } + + public static List buildInputs(String ... inputNames) { + List inputs = new ArrayList<>(); + for (String inputName : inputNames) { + InputDefinition inputDefinition = new InputDefinition(); + inputDefinition.setName(inputName); + inputs.add(inputDefinition); + } + return inputs; + } + + public static Resource buildResourceWithComponentInstance(String ... instanceNames) { + List instances = new ArrayList<>(); + for (String instanceName : instanceNames) { + ComponentInstance componentInstance = new ComponentInstanceBuilder().setName(instanceName).setComponentUid(instanceName).build(); + instances.add(componentInstance); + } + return buildResourceWithComponentInstances(instances); + } + + public static Resource buildResourceWithComponentInstances(List instances) { + Resource resource = buildBasicResource(); + resource.setComponentInstances(instances); + return resource; + } + + public static Resource buildResourceWithComponentInstances(ComponentInstance ... instances) { + return buildResourceWithComponentInstances(Arrays.asList(instances)); + } + + public static Resource buildResourceWithRelationships(RequirementCapabilityRelDef ... relations) { + Resource resource = buildBasicResource(); + ResourceBuilder resourceBuilder = new ResourceBuilder(resource); + for (RequirementCapabilityRelDef relation : relations) { + resourceBuilder.addRelationship(relation); + } + return resourceBuilder.build(); + } + + public static Resource buildBasicResource() { + Resource resource = new Resource(); + resource.setUniqueId("id"); + return resource; + } + + public static HeatParameterDefinition buildHeatParam(String defaultVal, String currValue) { + return new HeatParameterBuilder().setDefaultValue(defaultVal).setCurrentValue(currValue).build(); + } + +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionBuilder.java new file mode 100644 index 0000000000..e7ed170414 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/PropertyDataDefinitionBuilder.java @@ -0,0 +1,68 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.ArrayList; + +import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; + +public class PropertyDataDefinitionBuilder { + + private PropertyDefinition propertyDefinition; + + public PropertyDataDefinitionBuilder() { + propertyDefinition = new PropertyDefinition(); + } + + public PropertyDataDefinitionBuilder setUniqueId(String id) { + this.propertyDefinition.setUniqueId(id); + return this; + } + + public PropertyDataDefinitionBuilder setName(String name) { + this.propertyDefinition.setName(name); + return this; + } + + public PropertyDataDefinitionBuilder setValue(String value) { + this.propertyDefinition.setValue(value); + return this; + } + + public PropertyDataDefinitionBuilder setDefaultValue(String value) { + this.propertyDefinition.setDefaultValue(value); + return this; + } + + public PropertyDataDefinitionBuilder setType(String type) { + this.propertyDefinition.setType(type); + return this; + } + + public PropertyDataDefinitionBuilder setSchemaType(String type) { + if (propertyDefinition.getSchema() == null) { + propertyDefinition.setSchema(new SchemaDefinition()); + } + if (propertyDefinition.getSchema().getProperty() == null) { + propertyDefinition.getSchema().setProperty(new PropertyDataDefinition()); + } + propertyDefinition.getSchema().getProperty().setType(type); + return this; + } + + public PropertyDataDefinitionBuilder addGetInputValue(String inputName) { + GetInputValueDataDefinition getInputValueDataDefinition = new GetInputValueDataDefinition(); + getInputValueDataDefinition.setInputName(inputName); + getInputValueDataDefinition.setInputId(inputName); + if (propertyDefinition.getGetInputValues() == null) { + propertyDefinition.setGetInputValues(new ArrayList<>()); + } + propertyDefinition.getGetInputValues().add(getInputValueDataDefinition); + return this; + } + + public PropertyDefinition build() { + return propertyDefinition; + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/RelationsBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/RelationsBuilder.java new file mode 100644 index 0000000000..8c457f153f --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/RelationsBuilder.java @@ -0,0 +1,53 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.Collections; + +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; +import org.openecomp.sdc.be.model.RelationshipImpl; +import org.openecomp.sdc.be.model.RelationshipInfo; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; + +public class RelationsBuilder { + + private RequirementCapabilityRelDef relation; + + public RelationsBuilder() { + relation = new RequirementCapabilityRelDef(); + RelationshipInfo requirementAndRelationshipPair = new RelationshipInfo(); + RelationshipImpl relationship = new RelationshipImpl(); + requirementAndRelationshipPair.setRelationships(relationship); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(requirementAndRelationshipPair); + relation.setRelationships(Collections.singletonList(capReqRel)); + } + + public RelationsBuilder setFromNode(String fromNode) { + relation.setFromNode(fromNode); + return this; + } + + public RelationsBuilder setRequirementName(String reqName) { + relation.getSingleRelationship().getRelation().setRequirement(reqName); + return this; + } + + public RelationsBuilder setRelationType(String type) { + relation.getSingleRelationship().getRelation().getRelationship().setType(type); + return this; + } + + public RelationsBuilder setCapabilityUID(String uid) { + relation.getSingleRelationship().getRelation().setCapabilityUid(uid); + return this; + } + + public RelationsBuilder setToNode(String toNode) { + relation.setToNode(toNode); + return this; + } + + public RequirementCapabilityRelDef build() { + return relation; + } + +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ResourceBuilder.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ResourceBuilder.java new file mode 100644 index 0000000000..3d4a29da71 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/utils/ResourceBuilder.java @@ -0,0 +1,126 @@ +package org.openecomp.sdc.be.components.utils; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.Resource; + +public class ResourceBuilder { + + private Resource resource; + + public ResourceBuilder() { + this.resource = new Resource(); + } + + public ResourceBuilder(Resource resource) { + this.resource = resource; + } + + public ResourceBuilder setUniqueId(String id) { + resource.setUniqueId(id); + return this; + } + + public ResourceBuilder setInvariantUUid(String invariantUUid) { + resource.setInvariantUUID(invariantUUid); + return this; + } + + public ResourceBuilder setName(String name) { + resource.setName(name); + return this; + } + + public ResourceBuilder setComponentType(ComponentTypeEnum type) { + resource.setComponentType(type); + return this; + } + + public ResourceBuilder setSystemName(String systemName) { + resource.setSystemName(systemName); + return this; + } + + public ResourceBuilder addComponentInstance(ComponentInstance componentInstance) { + if (resource.getComponentInstances() == null) { + resource.setComponentInstances(new ArrayList<>()); + } + resource.getComponentInstances().add(componentInstance); + return this; + } + + public ResourceBuilder addInput(InputDefinition input) { + if (resource.getInputs() == null) { + resource.setInputs(new ArrayList<>()); + } + resource.getInputs().add(input); + return this; + } + + public ResourceBuilder addInput(String inputName) { + InputDefinition inputDefinition = new InputDefinition(); + inputDefinition.setName(inputName); + inputDefinition.setUniqueId(inputName); + this.addInput(inputDefinition); + return this; + } + + public ResourceBuilder addProperty(PropertyDefinition propertyDefinition) { + if (resource.getProperties() == null) { + resource.setProperties(new ArrayList<>()); + } + resource.getProperties().add(propertyDefinition); + return this; + } + + public ResourceBuilder addInstanceProperty(String instanceId, ComponentInstanceProperty prop) { + if (resource.getComponentInstancesProperties() == null) { + resource.setComponentInstancesProperties(new HashMap<>()); + } + resource.getComponentInstancesProperties().computeIfAbsent(instanceId, key -> new ArrayList<>()).add(prop); + return this; + } + + public ResourceBuilder addInstanceProperty(String instanceId, String propName) { + ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(); + componentInstanceProperty.setName(propName); + this.addInstanceProperty(instanceId, componentInstanceProperty); + return this; + } + + public ResourceBuilder addInstanceInput(String instanceId, ComponentInstanceInput prop) { + if (resource.getComponentInstancesInputs() == null) { + resource.setComponentInstancesInputs(new HashMap<>()); + } + resource.getComponentInstancesInputs().computeIfAbsent(instanceId, key -> new ArrayList<>()).add(prop); + return this; + } + + public ResourceBuilder addInstanceInput(String instanceId, String propName) { + ComponentInstanceInput componentInstanceInput = new ComponentInstanceInput(); + componentInstanceInput.setName(propName); + this.addInstanceInput(instanceId, componentInstanceInput); + return this; + } + + public ResourceBuilder addRelationship(RequirementCapabilityRelDef requirementCapabilityRelDef) { + if (resource.getComponentInstancesRelations() == null) { + resource.setComponentInstancesRelations(new ArrayList<>()); + } + resource.getComponentInstancesRelations().add(requirementCapabilityRelDef); + return this; + } + + + public Resource build() { + return resource; + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogicTest.java index 104cd14e7a..290a5f4d1d 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/DistributionBusinessLogicTest.java @@ -37,8 +37,6 @@ import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; import org.openecomp.sdc.be.components.distribution.engine.DistributionEngineInitTask; import org.openecomp.sdc.be.components.distribution.engine.SubscriberTypeEnum; import org.openecomp.sdc.be.config.DistributionEngineConfiguration; -import org.openecomp.sdc.be.distribution.AuditHandler; -import org.openecomp.sdc.be.distribution.DistributionBusinessLogic; import org.openecomp.sdc.be.distribution.api.client.CambriaOperationStatus; import org.openecomp.sdc.be.distribution.api.client.RegistrationRequest; import org.openecomp.sdc.be.distribution.api.client.TopicRegistrationResponse; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/ServiceDistributionArtifactsBuilderTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/ServiceDistributionArtifactsBuilderTest.java index 1c84cf6ca6..4e27c30f8a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/ServiceDistributionArtifactsBuilderTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/ServiceDistributionArtifactsBuilderTest.java @@ -26,6 +26,8 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + import org.junit.Test; import org.mockito.InjectMocks; import org.openecomp.sdc.be.components.BaseConfDependentTest; @@ -33,6 +35,7 @@ import org.openecomp.sdc.be.components.distribution.engine.ArtifactInfoImpl; import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; public class ServiceDistributionArtifactsBuilderTest extends BaseConfDependentTest { @@ -63,12 +66,25 @@ public class ServiceDistributionArtifactsBuilderTest extends BaseConfDependentTe toscaTemplateArtifact.setArtifactType(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()); toscaTemplateArtifact.setArtifactLabel(artifactLabel); toscaTemplateArtifact.setEsId(esArtifactId); + toscaTemplateArtifact.setUniqueId(esArtifactId); toscaTemplateArtifact.setPayload(payload); Map toscaArtifacts = new HashMap<>(); toscaArtifacts.put(artifactLabel, toscaTemplateArtifact); service.setToscaArtifacts(toscaArtifacts); + ArtifactDefinition deploymentArtifact = new ArtifactDefinition(); + deploymentArtifact.setArtifactName("deployment.yaml"); + deploymentArtifact.setArtifactGroupType(ArtifactGroupTypeEnum.DEPLOYMENT); + deploymentArtifact.setArtifactType(ArtifactTypeEnum.OTHER.getType()); + deploymentArtifact.setArtifactLabel("deployment"); + deploymentArtifact.setEsId("deployment007"); + deploymentArtifact.setUniqueId("deployment007"); + deploymentArtifact.setPayload(payload); + Map deploymentArtifacts = new HashMap<>(); + deploymentArtifacts.put("deployment", deploymentArtifact); + service.setDeploymentArtifacts(deploymentArtifacts); + Class targetClass = ServiceDistributionArtifactsBuilder.class; String methodName = "convertServiceArtifactsToArtifactInfo"; Object[] argObjects = {service}; @@ -79,8 +95,9 @@ public class ServiceDistributionArtifactsBuilderTest extends BaseConfDependentTe List convertServiceArtifactsToArtifactInfoRes = (List) method.invoke(serviceDistributionArtifactsBuilder, argObjects); assertTrue(convertServiceArtifactsToArtifactInfoRes != null); - assertTrue(convertServiceArtifactsToArtifactInfoRes.size() == 1); - assertTrue(convertServiceArtifactsToArtifactInfoRes.get(0).getArtifactName().equals(artifactName)); + assertTrue(convertServiceArtifactsToArtifactInfoRes.size() == 2); + List artifactsNames = convertServiceArtifactsToArtifactInfoRes.stream().map(a->a.getArtifactName()).collect(Collectors.toList()); + assertTrue(artifactsNames.contains(artifactName) && artifactsNames.contains("deployment.yaml")); } catch (Exception e) { e.printStackTrace(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java new file mode 100644 index 0000000000..74f0eac5ad --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java @@ -0,0 +1,188 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.be.distribution; + +import java.util.ArrayList; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; +import org.openecomp.sdc.be.components.distribution.engine.INotificationData; +import org.openecomp.sdc.be.components.distribution.engine.NotificationDataImpl; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +public class TestQueue { + + public static void main(String[] args) { + ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder(); + threadFactoryBuilder.setNameFormat("distribution-notification-thread"); + ThreadFactory threadFactory = threadFactoryBuilder.build(); + // TODO: add the package of google to the pom + + ExecutorService executorService = new ThreadPoolExecutor(0, 10, 60L, TimeUnit.SECONDS, new SynchronousQueue(), threadFactory); + // ExecutorService executorService = new ThreadPoolExecutor(0, 2, 60L, + // TimeUnit.SECONDS, new ArrayBlockingQueue(20)); + + // 2 threads are always up and they handle the tasks. in case core size + // is 0, only one is handles the tasks. + // ExecutorService executorService = new ThreadPoolExecutor(0, 2, 60L, + // TimeUnit.SECONDS, new ArrayBlockingQueue(20)); + + // TODO : check what happen when the number of threads are full. Throw + // RejectedExecutionException + // TODO : check what happen whether the pool is full and the size of + // pool + + ExecutorService newCachedThreadPool = Executors.newCachedThreadPool(threadFactory); + Runnable task = new Runnable() { + + @Override + public void run() { + try { + System.out.println("iN SLEEP" + Thread.currentThread()); + Thread.sleep(10 * 1000); + System.out.println("OUT SLEEP"); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }; + + for (int i = 0; i < 4; i++) { + try { + executorService.submit(task); + } catch (RejectedExecutionException e) { + e.printStackTrace(); + } + } + + newCachedThreadPool.submit(task); + System.out.println("After submitting the task"); + + MyWorker[] watchThreads = new MyWorker[1]; + BlockingQueue queue = new ArrayBlockingQueue<>(5); + for (int i = 0; i < watchThreads.length; i++) { + MyWorker myWorker = new MyWorker(queue); + myWorker.start(); + } + + for (int i = 0; i < 1; i++) { + try { + queue.put("message " + i); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + } + + public static class MyTimerTask extends TimerTask { + + AtomicBoolean state; + Thread thread; + + public MyTimerTask(AtomicBoolean state, Thread thread) { + super(); + this.state = state; + this.thread = thread; + + System.out.println("After create timer"); + } + + @Override + public void run() { + System.out.println("In running of Timer task"); + if (state.get() == false) { + System.out.println("In running of Timer task. Going to interrupt thread"); + // thread.interrupt(); + } else { + System.out.println("In running of Timer task. Finished."); + } + } + + } + + public static class MyWorker extends Thread { + + boolean active = true; + private final BlockingQueue queue; + + public MyWorker(BlockingQueue queue) { + this.queue = queue; + } + + Timer timer = new Timer(); + + public void run() { + try { + while (active) { + String s = queue.take(); + System.out.println("Thread " + Thread.currentThread() + " fecthed a message " + s); + + AtomicBoolean atomicBoolean = new AtomicBoolean(false); + MyTimerTask myTimerTask = new MyTimerTask(atomicBoolean, this); + timer.schedule(myTimerTask, 10 * 1000); + doWork(s); + atomicBoolean.set(true); + + } + } catch (InterruptedException ie) { + + System.out.println("Interrupted our thread"); + ie.printStackTrace(); + } + } + + private void doWork(String s) { + // TODO Auto-generated method stub + + CambriaHandler cambriaHandler = new CambriaHandler(); + INotificationData data = new NotificationDataImpl(); + List servers = new ArrayList<>(); + servers.add("aaaaaaa"); + cambriaHandler.sendNotification("topicName", "uebPublicKey", "uebSecretKey", servers, data); + + System.out.println("IN WORK " + s); + try { + Thread.sleep(1 * 1000); + } catch (InterruptedException e) { + + for (int i = 0; i < 10; i++) { + System.out.println("*************************************************"); + } + e.printStackTrace(); + } + } + } + +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/servlet/DistributionServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/servlet/DistributionServletTest.java index d6274ad90e..3aa143a389 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/servlet/DistributionServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/servlet/DistributionServletTest.java @@ -46,7 +46,6 @@ import org.openecomp.sdc.be.distribution.AuditHandler; import org.openecomp.sdc.be.distribution.DistributionBusinessLogic; import org.openecomp.sdc.be.distribution.api.client.RegistrationRequest; import org.openecomp.sdc.be.distribution.api.client.TopicRegistrationResponse; -import org.openecomp.sdc.be.distribution.servlet.DistributionServlet; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.common.api.Constants; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/GenerateEcompErrorFileTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/GenerateEcompErrorFileTest.java index e4f46dd4dd..1df88c3686 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/GenerateEcompErrorFileTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/GenerateEcompErrorFileTest.java @@ -20,21 +20,19 @@ package org.openecomp.sdc.be.ecomp; -import java.io.File; +import static org.junit.Assert.assertTrue; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Test; -import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.common.config.EcompClassification; import org.openecomp.sdc.common.config.EcompErrorCode; import org.openecomp.sdc.common.config.EcompErrorEnum; import org.openecomp.sdc.common.config.generation.GenerateEcompErrorsCsv; -import static org.junit.Assert.assertTrue; - public class GenerateEcompErrorFileTest { @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java index 640a9d2cf6..810da4c10b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java @@ -43,9 +43,7 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.Matchers; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.openecomp.sdc.be.components.impl.ElementBusinessLogic; import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; @@ -58,10 +56,8 @@ import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.ServletUtils; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; -import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.datastructure.FunctionalInterfaces; import org.openecomp.sdc.common.impl.ExternalConfiguration; @@ -115,7 +111,7 @@ public class AssetsDataServletTest extends JerseyTest { when(resource.getName()).thenReturn("MockVFCMT"); when(resource.getSystemName()).thenReturn("mockvfcmt"); Either eitherRet = Either.left(resource); - when(componentsUtils.convertJsonToObjectUsingObjectMapper(Mockito.anyString(), Mockito.any(User.class), Mockito.eq(Resource.class), Mockito.any(AuditingActionEnum.class), Mockito.eq(ComponentTypeEnum.RESOURCE))).thenReturn(eitherRet); + when(componentsUtils.convertJsonToObjectUsingObjectMapper(Mockito.any(), Mockito.any(), Mockito.eq(Resource.class), Mockito.any(), Mockito.eq(ComponentTypeEnum.RESOURCE))).thenReturn(eitherRet); when(webApplicationContext.getBean(ResourceImportManager.class)).thenReturn(resourceImportManager); when(webApplicationContext.getBean(ElementBusinessLogic.class)).thenReturn(elementBusinessLogic); @@ -123,7 +119,7 @@ public class AssetsDataServletTest extends JerseyTest { when(subCategoryDefinition.getName()).thenReturn("Monitoring Template"); when(categoryDefinition.getSubcategories()).thenReturn(Arrays.asList(subCategoryDefinition)); when(elementBusinessLogic.getAllResourceCategories()).thenReturn(Either.left(Arrays.asList(categoryDefinition))); - when(resourceBusinessLogic.createResource(Mockito.eq(resource), Mockito.any(AuditingActionEnum.class), Mockito.any(User.class), Mockito.anyMap(), Mockito.anyString())).thenReturn(Either.left(resource)); + when(resourceBusinessLogic.createResource(Mockito.eq(resource), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(Either.left(resource)); when(webApplicationContext.getBean(AssetMetadataConverter.class)).thenReturn(assetMetadataConverter); Mockito.doReturn(Either.left(resourceAssetMetadata)).when(assetMetadataConverter).convertToSingleAssetMetadata(Mockito.eq(resource), Mockito.anyString(), @@ -136,22 +132,21 @@ public class AssetsDataServletTest extends JerseyTest { private static void mockResponseFormat() { - when(componentsUtils.getResponseFormat(Mockito.any(ActionStatus.class), Matchers.anyVararg())).thenAnswer(new Answer(){ - public ResponseFormat answer(InvocationOnMock invocation) throws Throwable { - ResponseFormat ret; - final ActionStatus actionStatus = invocation.getArgumentAt(0, ActionStatus.class); - switch( actionStatus ){ - case CREATED :{ - ret = new ResponseFormat(HttpStatus.SC_CREATED); - break; - } - default :{ - ret = new ResponseFormat(HttpStatus.SC_INTERNAL_SERVER_ERROR); - break; - } - } - return ret; - }}); + when(componentsUtils.getResponseFormat(Mockito.any(ActionStatus.class), Mockito.any(String[].class))).thenAnswer((Answer) invocation -> { + ResponseFormat ret; + final ActionStatus actionStatus = invocation.getArgument(0); + switch( actionStatus ){ + case CREATED :{ + ret = new ResponseFormat(HttpStatus.SC_CREATED); + break; + } + default :{ + ret = new ResponseFormat(HttpStatus.SC_INTERNAL_SERVER_ERROR); + break; + } + } + return ret; + }); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadataTest.java index 673964e264..a2eb5336ed 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ArtifactMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadataTest.java index 1102dea900..f471e4971a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductAssetMetadataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadataTest.java index 0d931e15df..669f58c675 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ProductCategoryGroupMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadataTest.java index 83d048ae6b..b66341b8dd 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetDetailedMetadataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; public class ResourceAssetDetailedMetadataTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadataTest.java index d0d784f5a8..e1d276c839 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceAssetMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadataTest.java index ba9897c7dc..cd8439e34a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ResourceInstanceMetadataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadataTest.java index 29825a6e60..7279436d10 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetDetailedMetadataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadataTest.java index 6a4a38a02f..f6022263bd 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/representation/ServiceAssetMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.externalapi.servlet.representation; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java index b726bee926..811a3031ae 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java @@ -1,31 +1,15 @@ package org.openecomp.sdc.be.impl; import java.util.EnumMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; - -import org.apache.tinkerpop.gremlin.structure.T; -import org.codehaus.jackson.map.module.SimpleModule; import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.auditing.api.IAuditingManager; import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.graph.datatype.AdditionalInformationEnum; -import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.CapabilityTypeDefinition; import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ConsumerDefinition; -import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.GroupTypeDefinition; -import org.openecomp.sdc.be.model.PolicyTypeDefinition; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; @@ -34,10 +18,6 @@ import org.openecomp.sdc.be.tosca.ToscaError; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.exception.ResponseFormat; -import com.fasterxml.jackson.databind.JsonDeserializer; - -import fj.data.Either; - public class ComponentsUtilsTest { private ComponentsUtils createTestSubject() { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessInfoTest.java index 096bb4dca2..4bff2ecdeb 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessListTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessListTest.java index 2164b91542..4c8da955ae 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessListTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactAccessListTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfoTest.java index a9b9352673..b73874ea3a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactDefinitionInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.ArtifactDefinition; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTemplateInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTemplateInfoTest.java index 379959628c..e16540f523 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTemplateInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTemplateInfoTest.java @@ -1,8 +1,7 @@ package org.openecomp.sdc.be.info; -import static org.junit.Assert.*; -import java.util.*; -import org.junit.Assert; +import java.util.List; + import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java index 4010d9bf86..1474d9433b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.ArtifactType; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/CreateAndAssotiateInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/CreateAndAssotiateInfoTest.java index ad8e21bb84..e39e5819d3 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/CreateAndAssotiateInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/CreateAndAssotiateInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusInfoTest.java index dd8a3e6eee..329743f4a7 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.common.datastructure.ESTimeBasedEvent; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java index db4d735a7e..488cb31a55 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; public class DistributionStatusListResponseTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceInfoTest.java index 62b1bcbe0f..23abecb67d 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java index 830292a66f..4a5964aaf6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupDefinitionInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupDefinitionInfoTest.java index b2895d099c..662b96ccbf 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupDefinitionInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupDefinitionInfoTest.java @@ -2,12 +2,8 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.GroupProperty; -import java.util.*; -import org.junit.Assert; public class GroupDefinitionInfoTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupTemplateInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupTemplateInfoTest.java index 727a1f25d4..a77c1385a7 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupTemplateInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/GroupTemplateInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceInfoTest.java index 569b04d982..e8c9374447 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceInfoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceVersionInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceVersionInfoTest.java index 2b5e97e86d..d609f8090f 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceVersionInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServiceVersionInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; public class ServiceVersionInfoTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java index 085583aa2d..ca0006d43c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServletJsonResponseTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServletJsonResponseTest.java index 43144113ea..9b0c5fc453 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServletJsonResponseTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServletJsonResponseTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.info; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInfoTest.java index c96f71b8fd..c2a1e82564 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInfoTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInfoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java index 80ae443afe..67b0cdfd33 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.info; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java index 27963fa8cb..cee856d905 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java @@ -23,43 +23,26 @@ package org.openecomp.sdc.be.servlets; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; -import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; import java.util.Map; import java.util.stream.Stream; -import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.structure.T; -import org.glassfish.grizzly.servlet.ServletUtils; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; -import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.impl.ComponentsUtils; -import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.UploadResourceInfo; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.servlets.ResourceUploadServlet.ResourceAuthorityTypeEnum; import org.openecomp.sdc.common.datastructure.Wrapper; import org.openecomp.sdc.exception.ResponseFormat; import org.slf4j.Logger; -import com.google.common.base.Supplier; -import com.google.gson.Gson; - -import aj.org.objectweb.asm.Type; import fj.data.Either; public class AbstractValidationsServletTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java index 0cb9906dc4..dbb1f59f62 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java @@ -1,13 +1,9 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; -import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; public class AdditionalInformationServletTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ApplicationConfig.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ApplicationConfig.java index 2dda0f5d14..6ef8091921 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ApplicationConfig.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ApplicationConfig.java @@ -31,7 +31,6 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.server.ResourceConfig; import org.mockito.Mockito; -import org.openecomp.sdc.be.servlets.ResourceUploadServlet; public class ApplicationConfig extends Application { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java index b4d04f92a9..e546fcca55 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java @@ -1,12 +1,9 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; import org.junit.Test; -import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic.ArtifactOperationEnum; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; public class ArtifactServletTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java index 34a475882a..692158b881 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java index 52ee33fd74..97b1fe2a81 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java @@ -1,309 +1,136 @@ package org.openecomp.sdc.be.servlets; -import java.util.List; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; -import javax.annotation.Generated; +import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import javax.ws.rs.core.Application; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.apache.tinkerpop.gremlin.structure.T; +import org.glassfish.grizzly.http.util.HttpStatus; +import org.glassfish.hk2.utilities.binding.AbstractBinder; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.junit.BeforeClass; import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.sdc.be.components.impl.ServiceComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.VFComponentInstanceBusinessLogic; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.impl.ComponentsUtils; +import org.openecomp.sdc.be.impl.ServletUtils; +import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.exception.ResponseFormat; +import org.springframework.web.context.WebApplicationContext; import fj.data.Either; -public class ComponentInstanceServletTest { - - private ComponentInstanceServlet createTestSubject() { - return new ComponentInstanceServlet(); - } - - - @Test - public void testCreateComponentInstance() throws Exception { - ComponentInstanceServlet testSubject; - String data = ""; - String containerComponentId = ""; - String containerComponentType = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateComponentInstanceMetadata() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String componentInstanceId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateMultipleComponentInstance() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - String componentInstanceJsonArray = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteResourceInstance() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String resourceInstanceId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testAssociateRIToRI() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String userId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDissociateRIFromRI() throws Exception { - ComponentInstanceServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String userId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testCreateAndAssociateRIToRI() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceInstanceProperty() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String componentInstanceId = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceInstanceInput() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String componentInstanceId = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceInstanceAttribute() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String componentInstanceId = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteResourceInstanceProperty() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String componentInstanceId = ""; - String propertyId = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testChangeResourceInstanceVersion() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String componentInstanceId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateGroupInstanceProperty() throws Exception { - ComponentInstanceServlet testSubject; - String componentId = ""; - String containerComponentType = ""; - String componentInstanceId = ""; - String groupInstanceId = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetGroupArtifactById() throws Exception { - ComponentInstanceServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String groupInstId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetInstancePropertiesById() throws Exception { - ComponentInstanceServlet testSubject; - String containerComponentType = ""; - String containerComponentId = ""; - String componentInstanceUniqueId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testCreateServiceProxy() throws Exception { - ComponentInstanceServlet testSubject; - String data = ""; - String containerComponentId = ""; - String containerComponentType = ""; - String userId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteServiceProxy() throws Exception { - ComponentInstanceServlet testSubject; - String containerComponentId = ""; - String serviceProxyId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testChangeServiceProxyVersion() throws Exception { - ComponentInstanceServlet testSubject; - String containerComponentId = ""; - String serviceProxyId = ""; - String containerComponentType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - -} \ No newline at end of file +/** + * The test suite designed for test functionality of ComponentInstanceServlet class + */ +public class ComponentInstanceServletTest extends JerseyTest { + + private final static String USER_ID = "jh0003"; + private static HttpServletRequest request; + private static HttpSession session; + private static ServletContext servletContext; + private static WebAppContextWrapper webAppContextWrapper; + private static WebApplicationContext webApplicationContext; + private static VFComponentInstanceBusinessLogic vfBusinessLogic; + private static ServiceComponentInstanceBusinessLogic serviceBusinessLogic; + private static ComponentsUtils componentsUtils; + private static ServletUtils servletUtils; + private static ResponseFormat responseFormat; + + @BeforeClass + public static void setup() { + createMocks(); + stubMethods(); + } + + @Test + public void testGetRelationByIdSuccess(){ + + String containerComponentType = "resources"; + String componentId = "componentId"; + String relationId = "relationId"; + String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/" + relationId + "/relationId"; + Either successResponse = Either.left(new RequirementCapabilityRelDef()); + when(vfBusinessLogic.getRelationById(eq(componentId), eq(relationId), eq(USER_ID), eq(ComponentTypeEnum.RESOURCE))).thenReturn(successResponse); + when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200.getStatusCode()); + when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat); + Response response = target() + .path(path) + .request(MediaType.APPLICATION_JSON) + .header("USER_ID", USER_ID) + .get( Response.class); + + assertTrue(response.getStatus() == HttpStatus.OK_200.getStatusCode()); + } + + @Test + public void testGetRelationByIdFailure(){ + + String containerComponentType = "unknown_type"; + String componentId = "componentId"; + String relationId = "relationId"; + String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/" + relationId + "/relationId"; + when(responseFormat.getStatus()).thenReturn(HttpStatus.BAD_REQUEST_400.getStatusCode()); + when(componentsUtils.getResponseFormat(eq(ActionStatus.UNSUPPORTED_ERROR), eq(containerComponentType))).thenReturn(responseFormat); + Response response = target() + .path(path) + .request(MediaType.APPLICATION_JSON) + .header("USER_ID", USER_ID) + .get( Response.class); + + assertTrue(response.getStatus() == HttpStatus.BAD_REQUEST_400.getStatusCode()); + } + + @Override + protected Application configure() { + + ResourceConfig resourceConfig = new ResourceConfig(ComponentInstanceServlet.class); + forceSet(TestProperties.CONTAINER_PORT, "0"); + + resourceConfig.register(new AbstractBinder() { + @Override + protected void configure() { + bind(request).to(HttpServletRequest.class); + } + }); + return resourceConfig; + } + + private static void createMocks() { + request = Mockito.mock(HttpServletRequest.class); + session = Mockito.mock(HttpSession.class); + servletContext = Mockito.mock(ServletContext.class); + webAppContextWrapper = Mockito.mock(WebAppContextWrapper.class); + webApplicationContext = Mockito.mock(WebApplicationContext.class); + vfBusinessLogic = Mockito.mock(VFComponentInstanceBusinessLogic.class); + serviceBusinessLogic = Mockito.mock(ServiceComponentInstanceBusinessLogic.class); + componentsUtils = Mockito.mock(ComponentsUtils.class); + servletUtils = Mockito.mock(ServletUtils.class); + responseFormat = Mockito.mock(ResponseFormat.class); + } + + private static void stubMethods() { + when(request.getSession()).thenReturn(session); + when(session.getServletContext()).thenReturn(servletContext); + when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)).thenReturn(webAppContextWrapper); + when(webAppContextWrapper.getWebAppContext(servletContext)).thenReturn(webApplicationContext); + when(webApplicationContext.getBean(VFComponentInstanceBusinessLogic.class)).thenReturn(vfBusinessLogic); + when(webApplicationContext.getBean(ServiceComponentInstanceBusinessLogic.class)).thenReturn(serviceBusinessLogic); + when(request.getHeader("USER_ID")).thenReturn(USER_ID); + when(webApplicationContext.getBean(ServletUtils.class)).thenReturn(servletUtils); + when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils); + } +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java index 3e97aa4cb0..7159f2e035 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.be.servlets; import java.util.List; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigMgrServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigMgrServletTest.java index 4f2ca19986..4c7caa63e6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigMgrServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigMgrServletTest.java @@ -1,9 +1,7 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; -import org.junit.Assert; import org.junit.Test; import com.datastax.driver.core.Configuration; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigServletTest.java index adc996eb4c..2593474f2b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConfigServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConsumerServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConsumerServletTest.java index 6360c5a76e..14b34a206e 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConsumerServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ConsumerServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CsarBuildServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CsarBuildServletTest.java index e80016a678..930fe88339 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CsarBuildServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CsarBuildServletTest.java @@ -1,15 +1,9 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; import org.junit.Test; -import org.openecomp.sdc.be.resources.data.ESArtifactData; - -import ch.qos.logback.classic.Logger; -import java.util.*; -import org.junit.Assert; public class CsarBuildServletTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java index 2233b4ebac..d022faabcd 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java index 2fe68d3a90..31068ccd17 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.be.servlets; import java.util.List; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java index 85b835076b..95f5174580 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java index 9cc13d32de..9ff55c22f0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/LifecycleServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/LifecycleServletTest.java index f92e439c9a..8ea39b7443 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/LifecycleServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/LifecycleServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ProductServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ProductServletTest.java index 2376ceea32..66208daaf7 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ProductServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ProductServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java index dd31364868..fe147b19a9 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.be.servlets; import java.util.Map; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; @@ -13,8 +12,6 @@ import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.model.PropertyDefinition; -import com.google.common.collect.Multiset.Entry; - import fj.data.Either; public class PropertyServletTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RepresentationUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RepresentationUtilsTest.java index c56fd474b4..f82fdfc1ef 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RepresentationUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RepresentationUtilsTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; - import org.apache.tinkerpop.gremlin.structure.T; import org.junit.Test; import org.openecomp.sdc.be.model.ArtifactDefinition; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RequirementsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RequirementsServletTest.java index 4407ec6577..a7c23732ee 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RequirementsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/RequirementsServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceArtifactDownloadServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceArtifactDownloadServletTest.java index b88a097412..319e59a5eb 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceArtifactDownloadServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceArtifactDownloadServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java index 107163c520..7e0c6b7647 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java @@ -53,7 +53,6 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.UploadResourceInfo; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.servlets.ResourcesServlet; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.Constants; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java index 252e9d8fbc..ff69241263 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceUploadServletTest.java @@ -20,8 +20,8 @@ package org.openecomp.sdc.be.servlets; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; import java.io.File; @@ -58,7 +58,6 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.UploadResourceInfo; import org.openecomp.sdc.be.resources.api.IResourceUploader; import org.openecomp.sdc.be.resources.data.ESArtifactData; -import org.openecomp.sdc.be.servlets.ResourceUploadServlet; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.impl.ExternalConfiguration; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java index 1844cfe188..841254e4dc 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java @@ -3,11 +3,9 @@ package org.openecomp.sdc.be.servlets; import java.util.List; import java.util.Map; -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.Resource; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ServiceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ServiceServletTest.java index 7a21a231d8..2b4ddfb7b4 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ServiceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ServiceServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesFetchServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesFetchServletTest.java index 94aaee2afc..e512d98ca9 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesFetchServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesFetchServletTest.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.servlets; -import javax.annotation.Generated; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Response; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java index 8f4f57e836..37a493de37 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java @@ -35,8 +35,6 @@ import javax.ws.rs.core.Application; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.structure.T; import org.glassfish.grizzly.http.util.HttpStatus; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.client.ClientConfig; @@ -61,15 +59,11 @@ import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; -import org.openecomp.sdc.common.datastructure.FunctionalInterfaces.ConsumerTwoParam; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.web.context.WebApplicationContext; -import com.google.common.base.Equivalence.Wrapper; -import com.google.common.base.Supplier; - import fj.data.Either; public class TypesUploadServletTest extends JerseyTest { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserAdminServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserAdminServletTest.java index 6fd930c684..afa0907f25 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserAdminServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserAdminServletTest.java @@ -35,7 +35,6 @@ import javax.ws.rs.core.Response; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java index f93819c0a1..0562a1a80c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.switchover.detector; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ArtifactTypesTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ArtifactTypesTest.java index dec4e78008..92fc2fd4cf 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ArtifactTypesTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ArtifactTypesTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.tosca; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.generator.data.ArtifactType; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java index 8acfe6cfea..7348156923 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java @@ -32,13 +32,10 @@ import org.junit.Before; import org.junit.Test; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.tosca.CsarUtils.NonMetaArtifactInfo; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; -import org.openecomp.sdc.exception.ResponseFormat; import fj.data.Either; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java index c77c0f10f3..139de137d9 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java @@ -1,11 +1,13 @@ package org.openecomp.sdc.be.tosca; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -13,6 +15,7 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; +import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.Resource; @@ -31,7 +34,7 @@ public class PropertyConvertorTest { property = new PropertyDefinition(); property.setName("myProperty"); property.setType(ToscaPropertyType.INTEGER.getType()); - dataTypes = new HashMap(); + dataTypes = new HashMap(); dataTypes.put(property.getName(), new DataTypeDefinition()); } @@ -49,7 +52,7 @@ public class PropertyConvertorTest { property.setDefaultValue(def); ToscaProperty result = PropertyConvertor.getInstance().convertProperty(dataTypes, property, false); assertNotNull(result); - assertEquals(Integer.valueOf(def).intValue(), result.getDefaultp()); + assertEquals(Integer.valueOf(def), result.getDefaultp()); } @Test @@ -60,7 +63,7 @@ public class PropertyConvertorTest { property1.setDefaultValue("2"); dataTypes.put(property1.getName(), new DataTypeDefinition()); Resource resource = new Resource(); - List properties = new ArrayList(); + List properties = new ArrayList(); properties.add(property); properties.add(property1); resource.setProperties(properties); @@ -86,7 +89,7 @@ public class PropertyConvertorTest { property.setDefaultValue("1"); dataTypes.put(property1.getName(), new DataTypeDefinition()); Resource resource = new Resource(); - List properties = new ArrayList(); + List properties = new ArrayList(); properties.add(property); properties.add(property1); resource.setProperties(properties); @@ -106,7 +109,7 @@ public class PropertyConvertorTest { property1.setType(ToscaPropertyType.INTEGER.getType()); dataTypes.put(property1.getName(), new DataTypeDefinition()); Resource resource = new Resource(); - List properties = new ArrayList(); + List properties = new ArrayList(); properties.add(property); properties.add(property1); resource.setProperties(properties); @@ -118,4 +121,25 @@ public class PropertyConvertorTest { assertNull(prop.getDefaultp()); } } + + @Test + public void convertPropertyWhichStartsWithSemiColon() throws Exception { + PropertyDefinition property1 = new PropertyDataDefinitionBuilder() + .setDefaultValue("::") + .setType(ToscaPropertyType.STRING.getType()) + .build(); + ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, false); + assertThat(toscaProperty.getDefaultp()).isEqualTo("::"); + } + + @Test + public void convertPropertyWhichStartsWithSlash() throws Exception { + PropertyDefinition property1 = new PropertyDataDefinitionBuilder() + .setDefaultValue("/") + .setType(ToscaPropertyType.STRING.getType()) + .build(); + ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, false); + assertThat(toscaProperty.getDefaultp()).isEqualTo("/"); + } + } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/SchemaFiles.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/SchemaFiles.java index fdfd1c725f..acfeaf1abc 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/SchemaFiles.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/SchemaFiles.java @@ -20,7 +20,8 @@ package org.openecomp.sdc.be.tosca; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.FileInputStream; import java.io.IOException; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java index 7cb2ef7cf8..4399408c5c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.tosca; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.tosca.model.ToscaTemplate; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java new file mode 100644 index 0000000000..4c22cf3599 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportUtilsTest.java @@ -0,0 +1,124 @@ +package org.openecomp.sdc.be.tosca; + +import org.junit.Test; +import org.openecomp.sdc.be.components.impl.ServiceComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.components.impl.VFComponentInstanceBusinessLogic; +import org.openecomp.sdc.be.model.operations.impl.ComponentInstanceOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class ToscaExportUtilsTest { + private static Logger log = LoggerFactory.getLogger(ToscaExportUtilsTest.class.getName()); + @javax.annotation.Resource + private VFComponentInstanceBusinessLogic componentInstanceBusinessLogic; + @javax.annotation.Resource + private ServiceComponentInstanceBusinessLogic serviceInstanceBusinessLogic; + @Autowired + private ToscaExportHandler exportUtils; + @Autowired + private ComponentInstanceOperation componentInstanceOperation; + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + @Test + public void testExportService() { + /* Resource resource1 = ResourceTestUtils.prepareResource(0); + resource1.setResourceType(ResourceTypeEnum.VF); + Either createResource1 = resourceBusinessLogic.createResource(resource1, getAdminUser(), null, null); + assertTrue(createResource1.isLeft()); + Resource certifiedVFC1 = changeResourceStateToCertify(createResource1.left().value()); + + Resource resource2 = ResourceTestUtils.prepareResource(1); + resource2.setResourceType(ResourceTypeEnum.VF); + Either createResource2 = resourceBusinessLogic.createResource(resource2, getAdminUser(), null, null); + assertTrue(createResource2.isLeft()); + Resource certifiedVFC2 = changeResourceStateToCertify(createResource2.left().value()); + + Service service = ResourceTestUtils.prepareService(0); + Either createService = serviceBusinessLogic.createService(service, getAdminUser()); + assertTrue(createService.isLeft()); + + // add VFC instance to VF + ComponentInstance vfcResourceInstance1 = new ComponentInstance(); + vfcResourceInstance1.setDescription("VFC instance 1"); + vfcResourceInstance1.setName(certifiedVFC1.getName()); + vfcResourceInstance1.setComponentUid(certifiedVFC1.getUniqueId()); + + Either createResourceVfcInstance1 = serviceInstanceBusinessLogic.createComponentInstance(ComponentTypeEnum.SERVICE_PARAM_NAME, createService.left().value().getUniqueId(), adminUser.getAttuid(), + vfcResourceInstance1); + assertTrue(createResourceVfcInstance1.isLeft()); + + ComponentInstance vfcResourceInstance2 = new ComponentInstance(); + vfcResourceInstance2.setDescription("VFC instance 2"); + vfcResourceInstance2.setName(certifiedVFC2.getName()); + vfcResourceInstance2.setComponentUid(certifiedVFC2.getUniqueId()); + Either createResourceVfcInstance2 = serviceInstanceBusinessLogic.createComponentInstance(ComponentTypeEnum.SERVICE_PARAM_NAME, createService.left().value().getUniqueId(), adminUser.getAttuid(), + vfcResourceInstance2); + assertTrue(createResourceVfcInstance2.isLeft()); + + Either serviceFetch = serviceBusinessLogic.getService(createService.left().value().getUniqueId(), adminUser); + assertTrue(serviceFetch.isLeft()); + + List componentInstances = serviceFetch.left().value().getComponentInstances(); + String ciname1 = null; + String ciname2 = null; + + for (ComponentInstance ci : componentInstances) { + if (ci.getComponentUid().equals(certifiedVFC1.getUniqueId())) { + ciname1 = ci.getName(); + } + if (ci.getComponentUid().equals(certifiedVFC2.getUniqueId())) { + ciname2 = ci.getName(); + } + } + + Either result = exportUtils.exportComponent(serviceFetch.left().value()); + assertTrue(result.isLeft()); + + String mainYaml = result.left().value().getMainYaml(); + assertNotNull(mainYaml); + + YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter(); + assertTrue(yamlToObjectConverter.isValidYaml(mainYaml.getBytes())); + log.debug(mainYaml); + + Yaml yaml = new Yaml(); + + InputStream inputStream = new ByteArrayInputStream(mainYaml.getBytes()); + Map load = (Map) yaml.load(inputStream); + Map imports = (Map) load.get("imports"); + assertNotNull(imports); + assertEquals("Validate imports size in yml", 2, imports.size()); + + Map metadata = (Map) load.get("metadata"); + assertNotNull(metadata); + validateMetadata(metadata, serviceFetch.left().value(), false); + + Map vf1 = (Map) imports.get(certifiedVFC1.getName()); + String fileName = (String) vf1.get(ToscaExportHandler.IMPORTS_FILE_KEY); + ArtifactDefinition artifactDefinition = certifiedVFC1.getToscaArtifacts().get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE); + assertEquals("Validate 1 file name", artifactDefinition.getArtifactName(), fileName); + + Map topology_template = (Map) load.get("topology_template"); + Map node_templates = (Map) topology_template.get("node_templates"); + Map inst1 = (Map) node_templates.get(ciname1); + Map inst2 = (Map) node_templates.get(ciname2); + + Map inst1MD = (Map) inst1.get("metadata"); + Map inst2MD = (Map) inst2.get("metadata"); + + validateMetadata(inst1MD, certifiedVFC1, true); + + Map vf2 = (Map) imports.get(certifiedVFC2.getName()); + fileName = (String) vf2.get(ToscaExportHandler.IMPORTS_FILE_KEY); + artifactDefinition = certifiedVFC2.getToscaArtifacts().get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE); + assertEquals("Validate 2 file name", artifactDefinition.getArtifactName(), fileName); + + validateMetadata(inst2MD, certifiedVFC2, true);*/ + } + +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaRepresentationTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaRepresentationTest.java index 9af90bb9e4..f7c6f72932 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaRepresentationTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaRepresentationTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.tosca; import java.util.List; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.Triple; import org.junit.Test; import org.openecomp.sdc.be.model.Component; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaUtilsTest.java index c3a993596c..a9c87f7f61 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaUtilsTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.Component; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/EntrySchemaTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/EntrySchemaTest.java index ca3cd411dc..f57d17d164 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/EntrySchemaTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/EntrySchemaTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.tosca.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/SubstitutionMappingTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/SubstitutionMappingTest.java index f2e3e167df..661b8ca446 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/SubstitutionMappingTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/SubstitutionMappingTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaCapabilityTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaCapabilityTest.java index 01d65939d2..ba4526a68d 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaCapabilityTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaCapabilityTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaGroupTemplateTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaGroupTemplateTest.java index 06ff881988..a62c480505 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaGroupTemplateTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaGroupTemplateTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaMetadataTest.java index 6a4dc4583d..b7b7ba6514 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.tosca.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplateTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplateTest.java index 599f118b32..4dab33ce14 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplateTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplateTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTypeTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTypeTest.java index b4cccbdbf5..3bd04f1b92 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTypeTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTypeTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaPropertyTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaPropertyTest.java index 75bf7ddd75..52806cc6e6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaPropertyTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaPropertyTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.tosca.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaRequirementTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaRequirementTest.java index 639f634d7f..9f93675252 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaRequirementTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaRequirementTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateCapabilityTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateCapabilityTest.java index 788361862b..224c3084ad 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateCapabilityTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateCapabilityTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateRequirementTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateRequirementTest.java index 5ae2a37b37..a29be8a56f 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateRequirementTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateRequirementTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateTest.java index 3c60e96ffb..613c7ed457 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTopolgyTemplateTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTopolgyTemplateTest.java index 71fe9ce8e4..5b5ac82572 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTopolgyTemplateTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/ToscaTopolgyTemplateTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.tosca.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/VfModuleToscaMetadataTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/VfModuleToscaMetadataTest.java index 90be98bc9c..62fb750108 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/VfModuleToscaMetadataTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/model/VfModuleToscaMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.tosca.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/RollbackManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/RollbackManagerTest.java index 6558b140c7..9124aa3c45 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/RollbackManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/RollbackManagerTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.common.transaction.mngr; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.common.transaction.api.RollbackHandler; import org.openecomp.sdc.common.transaction.api.TransactionUtils.DBActionCodeEnum; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/SdncTransactionTest.java b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/SdncTransactionTest.java index bf87033bfe..2984d25e20 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/SdncTransactionTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/SdncTransactionTest.java @@ -49,8 +49,6 @@ import org.openecomp.sdc.common.transaction.api.TransactionUtils.ESActionTypeEnu import org.openecomp.sdc.common.transaction.api.TransactionUtils.LogMessages; import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionCodeEnum; import org.openecomp.sdc.common.transaction.api.TransactionUtils.TransactionStatusEnum; -import org.openecomp.sdc.common.transaction.mngr.CommitManager; -import org.openecomp.sdc.common.transaction.mngr.TransactionSdncImpl; import org.slf4j.Logger; import fj.data.Either; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/TransactionManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/TransactionManagerTest.java index aca9db39c0..a2259acf02 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/TransactionManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/common/transaction/mngr/TransactionManagerTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.common.transaction.mngr; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.common.transaction.api.ITransactionSdnc; import org.openecomp.sdc.common.transaction.api.TransactionUtils.ActionTypeEnum; diff --git a/catalog-be/src/test/resources/config/catalog-be/configuration.yaml b/catalog-be/src/test/resources/config/catalog-be/configuration.yaml index 8be1322c2c..2ec7124e1c 100644 --- a/catalog-be/src/test/resources/config/catalog-be/configuration.yaml +++ b/catalog-be/src/test/resources/config/catalog-be/configuration.yaml @@ -22,7 +22,7 @@ beSslPort: 8443 version: 1.0 released: 2012-11-30 -toscaConformanceLevel: 4.0 +toscaConformanceLevel: 5.0 minToscaConformanceLevel: 3.0 titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties @@ -614,3 +614,21 @@ genericAssetNodeTypes: VF : org.openecomp.resource.abstract.nodes.VF PNF: org.openecomp.resource.abstract.nodes.PNF Service: org.openecomp.resource.abstract.nodes.service + +environmentContext: + defaultValue: General_Revenue-Bearing + validValues: + - Critical_Revenue-Bearing + - Vital_Revenue-Bearing + - Essential_Revenue-Bearing + - Important_Revenue-Bearing + - Needed_Revenue-Bearing + - Useful_Revenue-Bearing + - General_Revenue-Bearing + - Critical_Non-Revenue + - Vital_Non-Revenue + - Essential_Non-Revenue + - Important_Non-Revenue + - Needed_Non-Revenue + - Useful_Non-Revenue + - General_Non-Revenue diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentName.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentName.yaml new file mode 100644 index 0000000000..609741721b --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentName.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2__different_name: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRelationship.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRelationship.yaml new file mode 100644 index 0000000000..7f5f82139f --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRelationship.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.BindsTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementName.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementName.yaml new file mode 100644 index 0000000000..3088707250 --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementName.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2_diferent_name: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementNode.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementNode.yaml new file mode 100644 index 0000000000..d45a07322d --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentRequirementNode.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentType.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentType.yaml new file mode 100644 index 0000000000..ec5dc74516 --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeDifferentType.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessInstances.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessInstances.yaml new file mode 100644 index 0000000000..16dbedb9ca --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessInstances.yaml @@ -0,0 +1,3509 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessRequirements.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessRequirements.yaml new file mode 100644 index 0000000000..b2b59769ae --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeLessRequirements.yaml @@ -0,0 +1,3581 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeOrig.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeOrig.yaml new file mode 100644 index 0000000000..742590f686 --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeOrig.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeReuirementWithDifferentCapability.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeReuirementWithDifferentCapability.yaml new file mode 100644 index 0000000000..11383eddbc --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeReuirementWithDifferentCapability.yaml @@ -0,0 +1,3585 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Bindable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeWithMissingRelationship.yaml b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeWithMissingRelationship.yaml new file mode 100644 index 0000000000..ea58ae9fc6 --- /dev/null +++ b/catalog-be/src/test/resources/yamlValidation/csarComparer/vmmeWithMissingRelationship.yaml @@ -0,0 +1,3584 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + vlc4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal2 + default: 00:80:37:0E:04:12 + sctp-a-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal2 + default: 00:80:37:0E:09:12 + sctp-a-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + gpb8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal1 + default: 00:80:37:0E:10:22 + sctp-a-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-a-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + ncb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: nv.c8r32d1 + vlc3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal1 + default: 00:80:37:0E:03:12 + Internal2_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-2 network + default: 169.255.0.0 + sctp-a-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + gpb4_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal2 + default: 00:80:37:0E:0C:22 + sctp-b-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + vlc8_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal1 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + fsb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal1 + default: 00:80:37:0E:0D:12 + sctp-b-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-b-ipv4v6-sec-group + sctp-b-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + internal_net_id_1: + hidden: false + immutable: false + type: string + description: UUID of Internal2_net + default: e3397c69-a942-49aa-81cb-fb91ff34abc8 + sctp-a-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + internal_net_id_0: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net + default: 871de971-22ac-47b6-befb-50e7d4cb67ea + sctp_b_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPB + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-a-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + ncb_name_1: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: zrdm3mmex59ncb002 + ncb_name_0: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: zrdm3mmex59ncb001 + vlc_st_virtualization_type: + hidden: false + immutable: false + type: string + description: Indicates virtualization type + default: virtual-machine + vlc2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal1 + default: 00:80:37:0E:02:12 + sctp-b-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-display_name: + hidden: false + immutable: false + type: string + description: display_name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + sctp-b-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + int2_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-2 + default: int2-sec-group + gpb5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal2 + default: 00:80:37:0E:0D:22 + sctp-a-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + OS::stack_name: + type: string + required: false + sctp-b-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + Internal2_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-2 network + default: false + sctp-a-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + Internal2_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-2 network + default: disable + vlc5_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal2 + default: 00:80:37:0E:05:12 + sctp-a-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-1 network + default: l2 + gpb3_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal1 + default: 00:80:37:0E:0B:22 + vip_oam_management_v4_ip: + hidden: false + immutable: false + type: string + description: IP address of OAM service IP address to be provisioned in A&AI + default: 107.239.72.176 + vmi_oam_preference_primary: + hidden: false + immutable: false + type: float + description: Preference for primary interface/port + default: 200 + sctp-b-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + security_group_sctp_b_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 92a4ae54-1733-4d03-b488-f178bb9f7b82 + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + description: L2 or L3 forwarding mode for internal-2 network + default: l2 + sctp-a-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-egress-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: dst subnet + default: '::' + sctp-b-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + security_group_oam_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 4ae4aa74-3e8e-4f2b-8b5f-a8bd262da96b + gpb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal1 + default: 00:80:37:0E:0A:22 + security_group_int1_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 94c62578-835d-4801-9372-70a2cfb22683 + sctp-a-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + oam_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN OAM + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + ncb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal2 + default: 00:80:37:0E:0F:12 + vlc_st_interface_type_sctp_a: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: left + gpb3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb3_Internal2 + default: 00:80:37:0E:0B:22 + vlc_st_interface_type_sctp_b: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: right + gpb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal2 + default: 00:80:37:0E:09:22 + oam_net_name: + hidden: false + immutable: false + type: string + description: Network Name OAM + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_OAM_net_1 + sctp-b-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal1 + default: 00:80:37:0E:0B:12 + sctp-b-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + vlc_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: management + shc_monitor_type: + hidden: false + immutable: false + type: string + description: health check + default: PING + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for OAM + default: oam-sec-group + Internal2_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-2 network + default: 169.255.0.3 + evac_policy: + hidden: false + immutable: false + type: string + description: CMHA Policy + default: Evacuate + server_group_id_0: + hidden: false + immutable: false + type: string + description: ID of Anti-Affinity Policy-based Server Group + default: ec99a73d-38f8-4280-8103-ba8ee584629f + vlc8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc8_Internal2 + default: 00:80:37:0E:08:12 + sctp-b-ipv6-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + gtp_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for GTP + default: gtp-sec-group + vlc_sctp_b_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: fd00:200:200:5:0:0:0:24 + vlc_sctp_b_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: fd00:200:200:5:0:0:0:17 + sctp-a-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + vlc_sctp_b_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: fd00:200:200:5:0:0:0:16 + vlc4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc4_Internal1 + default: 00:80:37:0E:04:12 + vlc_sctp_b_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: fd00:200:200:5:0:0:0:28 + vlc_sctp_b_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: fd00:200:200:5:0:0:0:27 + vlc_sctp_b_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: fd00:200:200:5:0:0:0:26 + vlc_sctp_b_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: fd00:200:200:5:0:0:0:25 + sctp_b_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPB + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPB_net_1 + sctp-b-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + sctp-a-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + Internal1_shared: + hidden: false + immutable: false + type: string + description: Whether Shared or private internal-1 network + default: false + shc_url_path: + hidden: false + immutable: false + type: string + description: health check + default: local-ip + Internal2_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-2 network + default: 17 + sctp-a-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_st_service_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + sctp-b-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + vlc_st_availability_zone: + hidden: false + immutable: false + type: string + description: Indicates availability zone is enabled + default: true + vlc7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal1 + default: 00:80:37:0E:07:12 + fsb_volume_image_name_1: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB2_1_3_GA.qcow2 + vlc_oam_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 OAM + default: 107.239.72.151 + sctp-a-ipv6-ingress_src_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix length + default: '0' + vlc_oam_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 OAM + default: 107.239.72.152 + Internal1_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-1 network + default: true + vlc_oam_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 OAM + default: 107.239.72.157 + vlc_oam_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 OAM + default: 107.239.72.158 + vlc_gtp_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 GTP + default: 107.243.47.208 + vlc_oam_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 OAM + default: 107.239.72.149 + fsb_volume_image_name_0: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: volume name + default: MME_FSB1_1_3_GA.qcow2 + vlc_gtp_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 GTP + default: 107.243.47.209 + vlc_oam_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 OAM + default: 107.239.72.150 + vlc_gtp_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 GTP + default: 107.243.47.216 + vlc_name_6: + hidden: false + immutable: false + type: string + description: Name of vlc7 + default: zrdm3mmex59vlc007 + vlc_gtp_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 GTP + default: 107.243.47.217 + vlc_name_7: + hidden: false + immutable: false + type: string + description: Name of vlc8 + default: zrdm3mmex59vlc008 + security_group_sctp_a_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: 3cd8a524-77ff-4980-ae2a-d19ba70e0511 + vlc_gtp_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 GTP + default: 107.243.47.218 + vlc_gtp_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 GTP + default: 107.243.47.219 + vlc_gtp_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 GTP + default: 107.243.47.220 + vlc_name_2: + hidden: false + immutable: false + type: string + description: Name of vlc3 + default: zrdm3mmex59vlc003 + vlc_gtp_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 GTP + default: 107.243.47.221 + vlc_name_3: + hidden: false + immutable: false + type: string + description: Name of vlc4 + default: zrdm3mmex59vlc004 + vlc_name_4: + hidden: false + immutable: false + type: string + description: Name of vlc5 + default: zrdm3mmex59vlc005 + vlc_name_5: + hidden: false + immutable: false + type: string + description: Name of vlc6 + default: zrdm3mmex59vlc006 + fsb_volume_id_1: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB2 + default: 5bd0560c-bfd0-47dc-a84a-554e2698c925 + sctp-a-ipv6-ingress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc_name_0: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: zrdm3mmex59vlc001 + vlc_name_1: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: zrdm3mmex59vlc002 + vlc_oam_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on OAM + sctp-b-egress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + vlc_oam_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 OAM + default: 107.239.72.155 + vlc_oam_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 OAM + default: 107.239.72.156 + vlc6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal1 + default: 00:80:37:0E:06:12 + fsb_volume_id_0: + hidden: false + immutable: false + type: string + description: ID of Cinder Volume for FSB1 + default: 27baa6a0-b701-4795-bf5e-4f546b350b1f + sctp-b-egress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + gpb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2_Internal2 + default: 00:80:37:0E:0A:22 + sctp-a-ipv6-egress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + sctp-b-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + Internal2_allow_transit: + hidden: false + immutable: false + type: string + description: Allow/disallow transit internal-2 network + default: true + fsb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: volume size 320GB + default: 320 + constraints: + - in_range: + - 0 + - 340 + sctp-b-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + gtp_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN GTP + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + ncb2_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2_Internal1 + default: 00:80:37:0E:0F:12 + sctp-b-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + sctp-b-ingress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-b-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + gpb7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal2 + default: 00:80:37:0E:0F:22 + sctp-a-ipv6-ingress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 starting port for destination + default: 0 + gtp_net_name: + hidden: false + immutable: false + type: string + description: Network Name GTP + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_GTP_net_1 + sctp-b-ipv6-ingress_rule_application: + hidden: false + immutable: false + type: string + description: IPV6 Rule-application + default: any + domain_name: + hidden: false + immutable: false + type: string + description: Unique name of vMME contrail domain + default: default-domain + vlc5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc5_Internal1 + default: 00:80:37:0E:05:12 + sctp-a-egress_src_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-egress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + shc_enabled: + hidden: false + immutable: false + type: string + description: health check + default: true + sctp-b-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-b-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp_a_net_fqdn: + hidden: false + immutable: false + type: string + description: Network FQDN SCTPA + default: default-domain:vMME-24474-Ericsson-WTC-Lab-vLCP1-4:vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + security_group_gtp_id: + hidden: false + immutable: false + type: string + description: Security Group UUID for output + default: e8ad3fe2-5f95-43e4-bbcc-da97b1c22588 + sctp-a-ipv6-ingress_src_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + fsb_name_1: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb002 + sctp-b-egress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb_name_0: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: zrdm3mmex59fsb001 + sctp_a_net_name: + hidden: false + immutable: false + type: string + description: Network Name SCTPA + default: vMME-24474-Ericsson-WTC-Lab-vLCP1-4_gn_SCTPA_net_1 + sctp-b-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + gpb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1_Internal1 + default: 00:80:37:0E:09:22 + sctp-a-ingress-dst_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + fsb1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1_Internal2 + default: 00:80:37:0E:0B:12 + vlc_st_service_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + sctp-a-ipv6-egress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-a-egress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-b-egress_action: + hidden: false + immutable: false + type: string + description: simple_action for the SecurityGroup + default: pass + sctp-a-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + sctp-a-ipv6-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: IPV6 start port + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: the vf_module_id for this instance. UUID provided by ECOMP + default: TWO + Internal1_net_cidr: + hidden: false + immutable: false + type: string + description: CIDR for internal-1 network + default: 169.253.0.0 + fsb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: nv.c8r32d1 + sctp_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: 132 + vnf_name: + hidden: false + immutable: false + type: string + description: the vnf_name for this instance. provided by ECOMP + default: zrdm3mmex59 + sctp-a-IPv6_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv6 + vlc_sctp_b_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: fd00:200:200:5:0:0:0:29 + vlc6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc6_Internal2 + default: 00:80:37:0E:06:12 + sctp-b-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc7_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc7_Internal2 + default: 00:80:37:0E:07:12 + sctp-a-ipv6-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: IPV6 ending port for destination + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: nd.c16r64d1 + sctp-b-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_st_interface_type_int1: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other1 + availability_zone_0: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: rdm3-kvm-az02 + service_instance_id_0: + hidden: false + immutable: false + type: string + description: UUID of service instance for vLCs + default: 77c67cc8-d15f-47bc-aeb1-8d65d09e917a + availability_zone_1: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: rdm3-kvm-az02 + vlc_st_interface_type_int2: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other2 + sctp-a-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + sctp-a-ipv6-egress_dst_subnet_prefix_len: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: '0' + vlc_sctp_a_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: 107.243.47.144 + vlc_sctp_b_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPB + vlc1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal1 + default: 00:80:37:0E:01:12 + sctp-b-ipv6-egress_src_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + sctp-a-ipv6-egress_src_addresses: + hidden: false + immutable: false + type: string + description: IPV6 source + default: local + vlc_sctp_a_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: 107.243.47.157 + sctp-a-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + vlc_sctp_a_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: 107.243.47.156 + vlc_sctp_a_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: 107.243.47.155 + sctp-a-ingress-dst_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: 107.243.47.154 + vlc_sctp_a_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: 107.243.47.153 + vlc_sctp_a_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: 107.243.47.152 + vlc_sctp_a_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: 107.243.47.145 + gpb6_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal2 + default: 00:80:37:0E:0E:22 + security_group_int2_id: + hidden: false + immutable: false + type: string + description: UUID of Internal1_net security group + default: 1361f069-baf2-4b76-b321-7f68ba26c369 + Internal2_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-2 network + default: false + sctp-a-dst_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + pxe_image_name: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-Boot_1_3_GA.qcow2 + vlc_st_interface_type_gtp: + hidden: false + immutable: false + type: string + description: service_interface_type for the ServiceTemplate + default: other0 + ncb1_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1_Internal1 + default: 00:80:37:0E:09:12 + vlc_gtp_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on GTP + int1_sec_group_name: + hidden: false + immutable: false + type: string + description: SecurityGroup name for internal-1 + default: int1-sec-group + vmi_oam_preference_secondary: + hidden: false + immutable: false + type: float + description: Preference for secondary interface/port + default: 100 + Internal1_dhcp: + hidden: false + immutable: false + type: string + description: Whether DHCP/static IP addressing on internal-1 network + default: false + fsb2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2_Internal2 + default: 00:80:37:0E:0D:12 + Internal1_net_cidr_len: + hidden: false + immutable: false + type: string + description: CIDR length for internal-1 network + default: 17 + sctp-a-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: security_group for the SecurityGroup + default: local + sctp-b-ingress-src_subnet_prefix_len: + hidden: false + immutable: false + type: float + description: ip_prefix_len for the SecurityGroup + default: '0' + constraints: + - in_range: + - 0 + - 32 + fsb_oam_ip_1: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB2 + default: 107.239.72.154 + fsb_oam_ip_0: + hidden: false + immutable: false + type: string + description: IP address of OAM vNIC for FSB1 + default: 107.239.72.153 + shc_timeout: + hidden: false + immutable: false + type: string + description: health check + default: 5 + vlc_st_version: + hidden: false + immutable: false + type: string + description: Indicates service version + default: 2 + sctp-a-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: '::' + sctp-a-ingress_rule_application: + hidden: false + immutable: false + type: string + description: application for the SecurityGroup + default: any + sctp-b-egress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-a-ipv6-egress_src_start_port: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0 + instance_ip_family_v6: + hidden: false + immutable: false + type: string + description: Ipv6 instance type + default: v6 + sctp-b-ingress-src_subnet_prefix_v6: + hidden: false + immutable: false + type: string + description: src subnet + default: '::' + gpb8_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb8_Internal2 + default: 00:80:37:0E:10:22 + gpb4_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb4_Internal1 + default: 00:80:37:0E:0C:22 + sctp-a-ipv6-ingress-dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + Internal1_net_gateway: + hidden: false + immutable: false + type: string + description: gateway for internal-1 network + default: 169.253.0.3 + sctp-b-ipv6-egress-dst_start_port: + hidden: false + immutable: false + type: string + description: IPV6 start port + default: 0 + gpb_name_7: + hidden: false + immutable: false + type: string + description: Name of gpb8 + default: zrdm3mmex59gpb0016 + gpb_name_6: + hidden: false + immutable: false + type: string + description: Name of gpb7 + default: zrdm3mmex59gpb0015 + gpb_name_5: + hidden: false + immutable: false + type: string + description: Name of gpb6 + default: zrdm3mmex59gpb0014 + gpb_name_4: + hidden: false + immutable: false + type: string + description: Name of gpb5 + default: zrdm3mmex59gpb0013 + gpb_name_3: + hidden: false + immutable: false + type: string + description: Name of gpb4 + default: zrdm3mmex59gpb0012 + sctp-a-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + gpb_name_2: + hidden: false + immutable: false + type: string + description: Name of gpb3 + default: zrdm3mmex59gpb0011 + shc_delay: + hidden: false + immutable: false + type: string + description: health check + default: 3 + gpb_name_1: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: zrdm3mmex59gpb0010 + sctp-b-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + vlc3_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc3_Internal2 + default: 00:80:37:0E:03:12 + gpb_name_0: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: zrdm3mmex59gpb009 + sctp-a-ipv6-egress_action: + hidden: false + immutable: false + type: string + description: IPV6 action + default: pass + gpb5_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb5_Internal1 + default: 00:80:37:0E:0D:22 + sctp-b-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + shc_max_retries: + hidden: false + immutable: false + type: string + description: health check + default: 2 + fsb_volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type SolidFire + default: SF-Default-SSD + sctp-a-name: + hidden: false + immutable: false + type: string + description: name for the SecurityGroup + default: epc-sctp-a-ipv4v6-sec-group + vlc_sctp_b_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPB + default: 107.243.47.187 + vlc_sctp_b_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPB + default: 107.243.47.186 + vlc_sctp_b_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPB + default: 107.243.47.185 + vlc_sctp_b_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPB + default: 107.243.47.184 + sctp-b-egress_rule_protocol: + hidden: false + immutable: false + type: string + description: protocol for the SecurityGroup + default: any + vnf_id: + hidden: false + immutable: false + type: string + description: the vf_id for this instance. UUID provided by ECOMP + default: zrdm3mmex59 + vlc_sctp_b_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPB + default: 107.243.47.189 + vlc_sctp_b_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPB + default: 107.243.47.188 + vlc_sctp_b_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPB + default: 107.243.47.177 + gpb6_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb6_Internal1 + default: 00:80:37:0E:0E:22 + sctp-b-ipv6-egress_dst_end_port: + hidden: false + immutable: false + type: string + description: IPV6 end port + default: 65535 + vlc_sctp_b_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPB + default: 107.243.47.176 + vlc2_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2_Internal2 + default: 00:80:37:0E:02:12 + sctp-b-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + gpb_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: nv.c20r64d1 + vlc_sctp_a_route_prefixes: + hidden: false + immutable: false + type: json + description: Route prefixes for static routing on SCTPA + sctp-b-ipv6-ingress_dst_addresses: + hidden: false + immutable: false + type: string + description: IPV6 destination + default: local + sctp-b-ipv6-ingress_ethertype: + hidden: false + immutable: false + type: string + description: IPV6 ethertype + default: IPv4 + sctp-b-ipv6-egress_dst_subnet_prefix: + hidden: false + immutable: false + type: string + description: IPV6 subnet prefix + default: 0.0.0.0 + sctp-a-ingress-src_subnet_prefix: + hidden: false + immutable: false + type: string + description: ip_prefix for the SecurityGroup + default: 0.0.0.0 + vlc1_Internal2_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1_Internal2 + default: 00:80:37:0E:01:12 + Internal1_rpf: + hidden: false + immutable: false + type: string + description: Reverse Path Forwarding Enabled/Disabled internal-1 network + default: disable + sctp-b-ingress_ethertype: + hidden: false + immutable: false + type: string + description: ethertype for the SecurityGroup + default: IPv4 + sctp-b-ingress-src_end_port: + hidden: false + immutable: false + type: float + description: end_port for the SecurityGroup + default: 65535 + constraints: + - in_range: + - 0 + - 65535 + sctp-a-ipv6-ingress_rule_protocol: + hidden: false + immutable: false + type: string + description: IPV6 Rule-protocol + default: any + vlc_sctp_a_v6_ip_7: + hidden: false + immutable: false + type: string + description: Static IP vlc8 SCTPA + default: fd00:200:200:4:0:0:0:29 + vlc_sctp_a_v6_ip_6: + hidden: false + immutable: false + type: string + description: Static IP vlc7 SCTPA + default: fd00:200:200:4:0:0:0:28 + gpb7_Internal1_mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb7_Internal1 + default: 00:80:37:0E:0F:22 + vlc_sctp_a_v6_ip_5: + hidden: false + immutable: false + type: string + description: Static IP vlc6 SCTPA + default: fd00:200:200:4:0:0:0:27 + vlc_sctp_a_v6_ip_4: + hidden: false + immutable: false + type: string + description: Static IP vlc5 SCTPA + default: fd00:200:200:4:0:0:0:26 + vlc_sctp_a_v6_ip_3: + hidden: false + immutable: false + type: string + description: Static IP vlc4 SCTPA + default: fd00:200:200:4:0:0:0:25 + vlc_sctp_a_v6_ip_2: + hidden: false + immutable: false + type: string + description: Static IP vlc3 SCTPA + default: fd00:200:200:4:0:0:0:24 + sctp-a-ingress-src_start_port: + hidden: false + immutable: false + type: float + description: start_port for the SecurityGroup + default: 0 + constraints: + - in_range: + - 0 + - 65535 + vlc_sctp_a_v6_ip_1: + hidden: false + immutable: false + type: string + description: Static IP vlc2 SCTPA + default: fd00:200:200:4:0:0:0:17 + vlc_sctp_a_v6_ip_0: + hidden: false + immutable: false + type: string + description: Static IP vlc1 SCTPA + default: fd00:200:200:4:0:0:0:16 + node_templates: + abstract_gpb_1: + type: org.openecomp.resource.abstract.nodes.gpb_1 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_1 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb2_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb2_Internal2_network: + - get_input: internal_net_id_1 + port_gpb2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb2_Internal1_replacement_policy: + - AUTO + port_gpb2_Internal1_network: + - get_input: internal_net_id_0 + port_gpb2_Internal2_replacement_policy: + - AUTO + port_gpb2_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb2_Internal1_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb2_Internal2_mac_address: + get_input: gpb2_Internal1_mac + port_gpb2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb2_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + abstract_gpb_2: + type: org.openecomp.resource.abstract.nodes.gpb_2 + directives: + - substitutable + properties: + port_gpb3_Internal1_replacement_policy: + - AUTO + compute_gpb_name: + - get_input: gpb_name_2 + port_gpb3_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb3_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb3_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb3_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb3_Internal1_network: + - get_input: internal_net_id_0 + port_gpb3_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb3_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb3_Internal1_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_address: + get_input: gpb3_Internal1_mac + port_gpb3_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_2ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb3_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb3_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_vlc: + type: org.openecomp.resource.abstract.nodes.vlc + directives: + - substitutable + properties: + port_template_VMInt_SCTP_A_vlc_virtual_network_refs: + - - get_input: sctp_a_net_fqdn + port_template_VMInt_INT1_vlc_security_group_refs: + - - get_input: security_group_int1_id + vm_flavor_name: + get_input: vlc_flavor_name + port_template_VMInt_INT2_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + vm_image_name: + get_input: pxe_image_name + port_template_VMInt_INT1_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_network_refs: + - - get_input: internal_net_id_1 + port_template_VMInt_OAM_vlc_virtual_network_refs: + - - get_input: oam_net_fqdn + port_template_VMInt_OAM_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_INT2_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal2_mac + - - get_input: vlc3_Internal2_mac + - - get_input: vlc2_Internal2_mac + - - get_input: vlc1_Internal2_mac + - - get_input: vlc8_Internal2_mac + - - get_input: vlc7_Internal2_mac + - - get_input: vlc6_Internal2_mac + - - get_input: vlc5_Internal2_mac + port_template_VMInt_SCTP_B_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_GTP_vlc_security_group_refs: + - - get_input: security_group_gtp_id + compute_vlc_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_template_VMInt_OAM_vlc_security_group_refs: + - - get_input: security_group_oam_id + compute_vlc_contrail_service_instance_ind: + - true + - true + - true + - true + - true + - true + - true + - true + port_template_VMInt_GTP_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + port_template_VMInt_SCTP_B_vlc_virtual_network_refs: + - - get_input: sctp_b_net_fqdn + port_template_VMInt_INT2_vlc_security_group_refs: + - - get_input: security_group_int2_id + port_template_VMInt_SCTP_B_vlc_security_group_refs: + - - get_input: security_group_sctp_b_id + port_template_VMInt_INT1_vlc_virtual_network_refs: + - - get_input: internal_net_id_0 + port_template_VMInt_SCTP_A_vlc_port_tuple_refs: + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc4 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc3 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc2 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc1 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc8 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc7 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc6 + - - UNSUPPORTED_RESOURCE_template_PortTuple_vlc5 + compute_vlc_scheduler_hints: + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + - group: + get_input: server_group_id_0 + compute_vlc_name: + - get_input: vlc_name_3 + - get_input: vlc_name_2 + - get_input: vlc_name_1 + - get_input: vlc_name_0 + - get_input: vlc_name_7 + - get_input: vlc_name_6 + - get_input: vlc_name_5 + - get_input: vlc_name_4 + port_template_VMInt_SCTP_A_vlc_security_group_refs: + - - get_input: security_group_sctp_a_id + compute_vlc_availability_zone: + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + - get_input: availability_zone_1 + - get_input: availability_zone_0 + port_template_VMInt_INT1_vlc_virtual_machine_interface_mac_addresses: + - - get_input: vlc4_Internal1_mac + - - get_input: vlc3_Internal1_mac + - - get_input: vlc2_Internal1_mac + - - get_input: vlc1_Internal1_mac + - - get_input: vlc8_Internal1_mac + - - get_input: vlc7_Internal1_mac + - - get_input: vlc6_Internal1_mac + - - get_input: vlc5_Internal1_mac + port_template_VMInt_GTP_vlc_virtual_network_refs: + - - get_input: gtp_net_fqdn + service_template_filter: + substitute_service_template: Nested_vlcServiceTemplate.yaml + count: 8 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: vlc + nfc_naming_code: vlc + requirements: + - link_vlc_template_VMInt_INT2_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + - link_vlc_template_VMInt_INT1_vlc: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_7: + type: org.openecomp.resource.abstract.nodes.gpb_7 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_7 + port_gpb8_Internal1_mac_address: + get_input: gpb8_Internal1_mac + port_gpb8_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb8_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb8_Internal1_replacement_policy: + - AUTO + port_gpb8_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb8_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_network: + - get_input: internal_net_id_0 + port_gpb8_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb8_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb8_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb8_Internal2_network: + - get_input: internal_net_id_1 + port_gpb8_Internal2_mac_address: + get_input: gpb8_Internal1_mac + service_template_filter: + substitute_service_template: Nested_gpb_7ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb8_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb8_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_5: + type: org.openecomp.resource.abstract.nodes.gpb_5 + directives: + - substitutable + properties: + port_gpb6_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_name: + - get_input: gpb_name_5 + vm_flavor_name: + get_input: gpb_flavor_name + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb6_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_image_name: + get_input: pxe_image_name + port_gpb6_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb6_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb6_Internal1_network: + - get_input: internal_net_id_0 + port_gpb6_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb6_Internal2_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal1_mac_address: + get_input: gpb6_Internal1_mac + port_gpb6_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb6_Internal2_replacement_policy: + - AUTO + port_gpb6_Internal1_replacement_policy: + - AUTO + port_gpb6_Internal2_security_groups: + - - get_input: security_group_int2_id + service_template_filter: + substitute_service_template: Nested_gpb_5ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb6_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb6_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_6: + type: org.openecomp.resource.abstract.nodes.gpb_6 + directives: + - substitutable + properties: + port_gpb7_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_network: + - get_input: internal_net_id_0 + compute_gpb_name: + - get_input: gpb_name_6 + port_gpb7_Internal2_network: + - get_input: internal_net_id_1 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb7_Internal1_replacement_policy: + - AUTO + port_gpb7_Internal2_replacement_policy: + - AUTO + port_gpb7_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb7_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb7_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb7_Internal2_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb7_Internal1_mac_address: + get_input: gpb7_Internal1_mac + port_gpb7_Internal2_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_gpb_6ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb7_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb7_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_3: + type: org.openecomp.resource.abstract.nodes.gpb_3 + directives: + - substitutable + properties: + compute_gpb_name: + - get_input: gpb_name_3 + port_gpb4_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb4_Internal1_mac_address: + get_input: gpb4_Internal1_mac + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb4_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_gpb4_Internal2_mac_address: + get_input: gpb4_Internal1_mac + vm_image_name: + get_input: pxe_image_name + port_gpb4_Internal2_security_groups: + - - get_input: security_group_int2_id + compute_gpb_availability_zone: + - get_input: availability_zone_1 + port_gpb4_Internal2_replacement_policy: + - AUTO + port_gpb4_Internal1_replacement_policy: + - AUTO + port_gpb4_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb4_Internal1_security_groups: + - - get_input: security_group_int1_id + port_gpb4_Internal2_network: + - get_input: internal_net_id_1 + port_gpb4_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_gpb4_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpb_3ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb4_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb4_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb_4: + type: org.openecomp.resource.abstract.nodes.gpb_4 + directives: + - substitutable + properties: + port_gpb5_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_gpb5_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_4 + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb5_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + port_gpb5_Internal2_network: + - get_input: internal_net_id_1 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb5_Internal1_network: + - get_input: internal_net_id_0 + port_gpb5_Internal2_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_mac_address: + get_input: gpb5_Internal1_mac + port_gpb5_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb5_Internal2_replacement_policy: + - AUTO + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb5_Internal1_replacement_policy: + - AUTO + port_gpb5_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb5_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_gpb_4ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb5_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb5_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_gpb: + type: org.openecomp.resource.abstract.nodes.gpb + directives: + - substitutable + properties: + port_gpb1_Internal1_security_groups: + - - get_input: security_group_int1_id + compute_gpb_name: + - get_input: gpb_name_0 + port_gpb1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + vm_flavor_name: + get_input: gpb_flavor_name + port_gpb1_Internal1_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_scheduler_hints: + - group: + get_input: server_group_id_0 + compute_gpb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + vm_image_name: + get_input: pxe_image_name + port_gpb1_Internal1_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_address: + get_input: gpb1_Internal1_mac + port_gpb1_Internal2_mac_requirements: + mac_count_required: + is_required: true + compute_gpb_availability_zone: + - get_input: availability_zone_0 + port_gpb1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_gpb1_Internal2_security_groups: + - - get_input: security_group_int2_id + port_gpb1_Internal1_replacement_policy: + - AUTO + port_gpb1_Internal2_replacement_policy: + - AUTO + port_gpb1_Internal2_network: + - get_input: internal_net_id_1 + port_gpb1_Internal1_network: + - get_input: internal_net_id_0 + service_template_filter: + substitute_service_template: Nested_gpbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: gpb + nfc_naming_code: gpb + requirements: + - link_gpb_gpb1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_gpb_gpb1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + Internal1_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_enable_dhcp: + get_input: Internal1_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal1_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal1_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal1_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_1 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal1 + abstract_fsb: + type: org.openecomp.resource.abstract.nodes.fsb + directives: + - substitutable + properties: + port_FSB1_Internal1_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_network_role_tag: + - oam + port_FSB1_Internal2_network: + - Internal2_net + port_FSB1_Internal1_network: + - Internal1_net + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB1_Internal2_mac_address: + get_input: fsb1_Internal1_mac + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB1_Internal1_security_groups: + - - int1_security_group + port_FSB1_Internal2_replacement_policy: + - AUTO + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + port_FSB1_Internal1_replacement_policy: + - AUTO + compute_fsb_name: + - get_input: fsb_name_0 + port_FSB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_0 + port_FSB1_Internal2_security_groups: + - - int2_security_group + port_FSB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_0 + service_template_filter: + substitute_service_template: Nested_fsbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + gtp_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: gtp_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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 + abstract_ncb_1: + type: org.openecomp.resource.abstract.nodes.ncb_1 + directives: + - substitutable + properties: + port_NCB2_Internal2_security_groups: + - - int2_security_group + port_NCB2_Internal1_replacement_policy: + - AUTO + port_NCB2_Internal2_replacement_policy: + - AUTO + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_NCB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + compute_ncb_availability_zone: + - get_input: availability_zone_1 + port_NCB2_Internal1_network: + - Internal1_net + port_NCB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB2_Internal1_security_groups: + - - int1_security_group + port_NCB2_Internal2_network: + - Internal2_net + port_NCB2_Internal1_mac_address: + get_input: ncb2_Internal1_mac + port_NCB2_Internal2_mac_address: + get_input: ncb2_Internal1_mac + compute_ncb_name: + - get_input: ncb_name_1 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + service_template_filter: + substitute_service_template: Nested_ncb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + abstract_ncb: + type: org.openecomp.resource.abstract.nodes.ncb + directives: + - substitutable + properties: + vm_flavor_name: + get_input: ncb_flavor_name + port_NCB1_Internal2_mac_requirements: + mac_count_required: + is_required: true + vm_image_name: + get_input: pxe_image_name + port_NCB1_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + compute_ncb_scheduler_hints: + - group: VM_Affinity_group + port_NCB1_Internal1_security_groups: + - - int1_security_group + compute_ncb_availability_zone: + - get_input: availability_zone_0 + port_NCB1_Internal2_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_mac_address: + get_input: ncb1_Internal1_mac + port_NCB1_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_NCB1_Internal1_mac_requirements: + mac_count_required: + is_required: true + port_NCB1_Internal2_replacement_policy: + - AUTO + port_NCB1_Internal1_network: + - Internal1_net + port_NCB1_Internal2_security_groups: + - - int2_security_group + port_NCB1_Internal1_replacement_policy: + - AUTO + compute_ncb_name: + - get_input: ncb_name_0 + compute_ncb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_NCB1_Internal2_network: + - Internal2_net + service_template_filter: + substitute_service_template: Nested_ncbServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: ncb + nfc_naming_code: ncb + requirements: + - link_ncb_NCB1_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_ncb_NCB1_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + int1_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int1_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB1_Internal1 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal1 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal1 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal1 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal1 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal1 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal1 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal1 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal1 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal1 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal1 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal1 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + fsb_volume_0: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_0 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB1_Vol_1 + fsb_volume_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: fsb_volume_image_name_1 + volume_type: + get_input: fsb_volume_type + size: '(get_input : fsb_volume_size) * 1024' + name: + list_join: + - _ + - - get_input: OS::stack_name + - FSB2_Vol_1 + Internal2_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_enable_dhcp: + get_input: Internal2_dhcp + network_ipam_refs_data_ipam_subnets_default_gateway: + get_input: Internal2_net_gateway + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: Internal2_net_cidr_len + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: Internal2_net_cidr + network_name: + str_replace: + template: $VNF_NAME_int_net_2 + params: + $VNF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_Internal2 + int2_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: int2_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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: 132 + 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: 132 + 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: 132 + 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: 132 + 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_fsb_FSB1_Internal2 + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB2_Internal2 + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB1_Internal2 + node: abstract_ncb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_ncb_NCB2_Internal2 + node: abstract_ncb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb1_Internal2 + node: abstract_gpb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb2_Internal2 + node: abstract_gpb_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb3_Internal2 + node: abstract_gpb_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb4_Internal2 + node: abstract_gpb_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb5_Internal2 + node: abstract_gpb_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb6_Internal2 + node: abstract_gpb_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb7_Internal2 + node: abstract_gpb_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_gpb_gpb8_Internal2 + node: abstract_gpb_7 + relationship: org.openecomp.relationships.AttachesTo + abstract_fsb_1: + type: org.openecomp.resource.abstract.nodes.fsb_1 + directives: + - substitutable + properties: + port_FSB_OAM_network_role_tag: + - oam + vm_flavor_name: + get_input: fsb_flavor_name + port_FSB_OAM_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + port_FSB2_Internal1_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB2_Internal2_security_groups: + - - int2_security_group + compute_fsb_metadata: + - vf_module_id: + get_input: vf_module_id + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + port_FSB2_Internal1_mac_address: + get_input: fsb2_Internal1_mac + compute_fsb_scheduler_hints: + - group: VM_Affinity_group + compute_fsb_name: + - get_input: fsb_name_1 + port_FSB2_Internal1_security_groups: + - - int1_security_group + port_FSB_OAM_network: + - get_input: oam_net_name + port_FSB_OAM_security_groups: + - - oam_security_group + port_FSB2_Internal1_network: + - Internal1_net + port_FSB2_Internal2_mac_address: + get_input: fsb2_Internal1_mac + port_FSB2_Internal2_mac_requirements: + mac_count_required: + is_required: true + port_FSB_OAM_mac_requirements: + mac_count_required: + is_required: false + port_FSB2_Internal2_replacement_policy: + - AUTO + port_FSB2_Internal2_ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + port_FSB_OAM_replacement_policy: + - AUTO + port_FSB2_Internal2_network: + - Internal2_net + port_FSB2_Internal1_replacement_policy: + - AUTO + compute_fsb_availability_zone: + - get_input: availability_zone_1 + port_FSB_OAM_fixed_ips: + - ip_address: + get_input: fsb_oam_ip_1 + port_FSB2_Internal1_mac_requirements: + mac_count_required: + is_required: true + service_template_filter: + substitute_service_template: Nested_fsb_1ServiceTemplate.yaml + count: 1 + index_value: + get_property: + - SELF + - service_template_filter + - index_value + vm_type_tag: fsb + nfc_naming_code: fsb + requirements: + - link_fsb_FSB2_Internal1: + capability: tosca.capabilities.network.Linkable + node: Internal1_net + relationship: tosca.relationships.network.LinksTo + - link_fsb_FSB2_Internal2: + capability: tosca.capabilities.network.Linkable + node: Internal2_net + relationship: tosca.relationships.network.LinksTo + oam_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_$SECGROUPNAME + params: + $SECGROUPNAME: + get_input: oam_sec_group_name + $VNF_NAME: + get_input: vnf_name + 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_fsb_FSB_OAM + node: abstract_fsb + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_fsb_FSB_OAM + node: abstract_fsb_1 + relationship: org.openecomp.relationships.AttachesTo + groups: + vmme_gpb3_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb3.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + base_vmme_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme.yml + description: | + Base HOT template to create vmme 2 fsb 2 ncb + members: + - int2_security_group + - oam_security_group + - gtp_security_group + - Internal2_net + - int1_security_group + - Internal1_net + - abstract_ncb + - abstract_ncb_1 + - abstract_fsb + - abstract_fsb_1 + base_vmme_volume_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_vmme_volume.yml + description: HOT template for vMME Cinder Volumes + members: + - fsb_volume_0 + - fsb_volume_1 + vmme_gpb1_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb1.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb4_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb4.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_gpb2_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_gpb2.yml + description: | + Module HOT template to create vmme 1-8 gpb + members: + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + VM_Affinity_group: + type: tosca.groups.Root + members: + - abstract_ncb + - abstract_ncb_1 + - abstract_vlc + - abstract_fsb + - abstract_fsb_1 + - abstract_gpb + - abstract_gpb_1 + - abstract_gpb_2 + - abstract_gpb_3 + - abstract_gpb_4 + - abstract_gpb_5 + - abstract_gpb_6 + - abstract_gpb_7 + vmme_vlc_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_vlc.yml + description: | + Module HOT template to create vmme 8 vlcs + members: + - abstract_vlc + outputs: + oam_management_v4_address: + description: ID of OAM VIP to be provisioned in A&AI + value: + get_input: vip_oam_management_v4_ip + fsb_volume_id_1: + description: ID of Cinder Volume for FSB2 + value: fsb_volume_1 + security_group_sctp_b_id: + description: ID of sctpb_security_group + value: UNSUPPORTED_RESOURCE_sctpb_security_group + service_instance_id_0: + description: ID of Service Instance used for vLCs + value: UNSUPPORTED_RESOURCE_template_ServiceInstance_VLC + security_group_sctp_a_id: + description: ID of sctpa_security_group + value: UNSUPPORTED_RESOURCE_sctpa_security_group + fsb_volume_id_0: + description: ID of Cinder Volume for FSB1 + value: fsb_volume_0 + policies: + VM_Affinity_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - VM_Affinity_group diff --git a/catalog-dao/.gitignore b/catalog-dao/.gitignore deleted file mode 100644 index ea8c4bf7f3..0000000000 --- a/catalog-dao/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/catalog-dao/pom.xml b/catalog-dao/pom.xml index ad6d2bd200..30335db43e 100644 --- a/catalog-dao/pom.xml +++ b/catalog-dao/pom.xml @@ -11,8 +11,11 @@ 1.2.0-SNAPSHOT + + true + + - org.openecomp.sdc @@ -118,8 +121,7 @@ org.mockito - mockito-all - ${mockito.version} + mockito-core test diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java index 4ae3e61841..3b440df653 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java @@ -26,6 +26,7 @@ public enum ActionStatus { USER_ALREADY_EXIST, USER_INACTIVE, USER_NOT_FOUND, USER_HAS_ACTIVE_ELEMENTS, INVALID_EMAIL_ADDRESS, INVALID_ROLE, DELETE_USER_ADMIN_CONFLICT, UPDATE_USER_ADMIN_CONFLICT, CANNOT_DELETE_USER_WITH_ACTIVE_ELEMENTS, CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS, INVALID_USER_ID, // CapabilityType related CAPABILITY_TYPE_ALREADY_EXIST, MISSING_CAPABILITY_TYPE, REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION, IMPORT_DUPLICATE_REQ_CAP_NAME, IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED, + CAPABILITY_OF_INSTANCE_NOT_FOUND_ON_CONTAINER, REQUIREMENT_OF_INSTANCE_NOT_FOUND_ON_CONTAINER, RELATION_NOT_FOUND, // Resource related RESOURCE_NOT_FOUND, MISSING_DERIVED_FROM_TEMPLATE, PARENT_RESOURCE_NOT_FOUND, PARENT_RESOURCE_DOES_NOT_EXTEND, INVALID_DEFAULT_VALUE, INVALID_COMPLEX_DEFAULT_VALUE, MULTIPLE_PARENT_RESOURCE_FOUND, INVALID_RESOURCE_PAYLOAD, INVALID_TOSCA_FILE_EXTENSION, INVALID_YAML_FILE, INVALID_TOSCA_TEMPLATE, NOT_RESOURCE_TOSCA_TEMPLATE, NOT_SINGLE_RESOURCE, INVALID_RESOURCE_NAMESPACE, RESOURCE_ALREADY_EXISTS, INVALID_RESOURCE_CHECKSUM, RESOURCE_CANNOT_CONTAIN_RESOURCE_INSTANCES, NO_ASSETS_FOUND, GENERIC_TYPE_NOT_FOUND,INVALID_RESOURCE_TYPE, TOSCA_PARSE_ERROR, // Service related @@ -89,6 +90,5 @@ public enum ActionStatus { // Inputs INPUT_IS_NOT_CHILD_OF_COMPONENT, CFVC_LOOP_DETECTED, - ; } diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactAccessor.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactAccessor.java index 61e23b8de2..871374eae9 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactAccessor.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactAccessor.java @@ -1,11 +1,9 @@ package org.openecomp.sdc.be.dao.cassandra; import com.datastax.driver.core.ResultSet; -import com.datastax.driver.mapping.Result; import com.datastax.driver.mapping.annotations.Accessor; import com.datastax.driver.mapping.annotations.Param; import com.datastax.driver.mapping.annotations.Query; -import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent; /** diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java index 5b37d3df2c..df107787e7 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.be.dao.cassandra; import javax.annotation.PostConstruct; -import com.datastax.driver.core.ResultSet; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.resources.data.ESArtifactData; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; @@ -30,6 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; +import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Session; import com.datastax.driver.mapping.MappingManager; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java index 10b9b0578c..38606d00e9 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java @@ -24,7 +24,6 @@ import java.util.List; import javax.annotation.PreDestroy; -import com.datastax.driver.core.policies.*; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.config.ConfigurationManager; import org.slf4j.Logger; @@ -33,6 +32,11 @@ import org.springframework.stereotype.Component; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; +import com.datastax.driver.core.policies.ConstantReconnectionPolicy; +import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; +import com.datastax.driver.core.policies.DefaultRetryPolicy; +import com.datastax.driver.core.policies.LoadBalancingPolicy; +import com.datastax.driver.core.policies.TokenAwarePolicy; import com.datastax.driver.mapping.Mapper; import com.datastax.driver.mapping.MappingManager; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java index 1d2eb15354..5ff2917c27 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java @@ -20,17 +20,18 @@ package org.openecomp.sdc.be.dao.cassandra; -import com.datastax.driver.core.ResultSet; -import com.datastax.driver.core.Statement; -import com.datastax.driver.core.querybuilder.QueryBuilder; -import fj.data.Either; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Session; +import com.datastax.driver.core.Statement; +import com.datastax.driver.core.querybuilder.QueryBuilder; import com.datastax.driver.mapping.MappingManager; +import fj.data.Either; + public abstract class CassandraDao { private static Logger logger = LoggerFactory.getLogger(CassandraDao.class.getName()); diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilder.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilder.java index f9dc9b22a4..fa5c4acaf3 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilder.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaBuilder.java @@ -20,21 +20,29 @@ package org.openecomp.sdc.be.dao.cassandra.schema; -import com.datastax.driver.core.*; -import com.datastax.driver.core.schemabuilder.Alter; -import com.datastax.driver.core.schemabuilder.Create; -import com.datastax.driver.core.schemabuilder.SchemaBuilder; -import com.datastax.driver.core.schemabuilder.SchemaStatement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.*; import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.tables.OldExternalApiEventTableDesc; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; -import java.util.stream.Collectors; +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.DataType; +import com.datastax.driver.core.KeyspaceMetadata; +import com.datastax.driver.core.Session; +import com.datastax.driver.core.schemabuilder.Alter; +import com.datastax.driver.core.schemabuilder.Create; +import com.datastax.driver.core.schemabuilder.SchemaBuilder; +import com.datastax.driver.core.schemabuilder.SchemaStatement; public class SdcSchemaBuilder { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java index 56cf32a152..e1e33871b1 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java @@ -20,12 +20,14 @@ package org.openecomp.sdc.be.dao.cassandra.schema; -import com.datastax.driver.core.*; +import java.util.List; + import org.openecomp.sdc.be.config.ConfigurationManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.Session; public class SdcSchemaUtils { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/Table.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/Table.java index f6fd29bd1f..5cbe2508b1 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/Table.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/Table.java @@ -20,7 +20,25 @@ package org.openecomp.sdc.be.dao.cassandra.schema; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.*; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.ArtifactTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.AuthEventTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.CategoryEventTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.ComponentCacheTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.ConsumerEventTableDefinition; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribDeployEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribDownloadEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribEngineEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribNotifEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribStatusEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.ExternalApiEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetCatHierEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetUebClusterEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetUsersListEventTableDesc; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.MigrationTasksTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.ResAdminEventTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.SdcSchemaFilesTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.UserAccessEventTableDescription; +import org.openecomp.sdc.be.dao.cassandra.schema.tables.UserAdminEventTableDescription; public enum Table { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescription.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescription.java index c49651e548..facbd5209a 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescription.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescription.java @@ -26,12 +26,10 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; -import com.datastax.driver.mapping.annotations.Column; public class CategoryEventTableDescription implements ITableDescription { @Override diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescription.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescription.java index 611138efa0..1d60bec1cc 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescription.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescription.java @@ -20,11 +20,12 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.Configuration; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinition.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinition.java index 68ec5620ba..46664c6df8 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinition.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinition.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetUebClusterEventTableDesc.DEEFieldsDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDesc.java index 32c2365b95..a233110f9e 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDesc.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribDownloadEventTableDesc.DSEFieldsDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java index d1c73bf46e..fe5bb465c3 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDesc.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDesc.java index cb659b9a8a..e35acc3790 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDesc.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDesc.java index 3858b7d8f6..4e44bd2975 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDesc.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetUsersListEventTableDesc.DEEFieldsDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDesc.java index 40a1827e36..92b10772e6 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDesc.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.DistribEngineEventTableDesc.DEEFieldsDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDesc.java index 4bd3e296ef..cdb603de6c 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDesc.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.dao.cassandra.schema.tables.GetUebClusterEventTableDesc.DEEFieldsDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescription.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescription.java index 885a7a7ce3..2e8c5ff024 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescription.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescription.java @@ -1,9 +1,7 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; -import com.datastax.driver.core.DataType; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; -import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; +import static org.openecomp.sdc.be.dao.cassandra.schema.tables.MigrationTasksTableDescription.SdcRepoFieldsDescription.MAJOR_VERSION; +import static org.openecomp.sdc.be.dao.cassandra.schema.tables.MigrationTasksTableDescription.SdcRepoFieldsDescription.MINOR_VERSION; import java.util.Arrays; import java.util.Collections; @@ -11,8 +9,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.openecomp.sdc.be.dao.cassandra.schema.tables.MigrationTasksTableDescription.SdcRepoFieldsDescription.MAJOR_VERSION; -import static org.openecomp.sdc.be.dao.cassandra.schema.tables.MigrationTasksTableDescription.SdcRepoFieldsDescription.MINOR_VERSION; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; +import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; + +import com.datastax.driver.core.DataType; public class MigrationTasksTableDescription implements ITableDescription { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDesc.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDesc.java index 7459a4b5d9..ec2dd368e3 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDesc.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDesc.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescription.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescription.java index e928982127..f6c5689973 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescription.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescription.java @@ -26,12 +26,10 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import com.datastax.driver.core.DataType; -import com.datastax.driver.mapping.annotations.Column; public class ResAdminEventTableDescription implements ITableDescription { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescription.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescription.java index dd8df08cdd..0cfdc2e462 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescription.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescription.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphEdge.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphEdge.java index 4555f9f9ea..2858a81a60 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphEdge.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphEdge.java @@ -22,9 +22,7 @@ package org.openecomp.sdc.be.dao.graph.datatype; import java.util.Map; -import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; -import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; public class GraphEdge { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/impl/ESTimeBasedDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/impl/ESTimeBasedDao.java index bdd1a2fb47..252240b164 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/impl/ESTimeBasedDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/impl/ESTimeBasedDao.java @@ -35,8 +35,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.sort.SortBuilder; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.ElasticSearchConfig.IndicesTimeFrequencyEntry; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.es.ElasticSearchClient; import org.openecomp.sdc.common.api.Constants; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java index 6966abb1c9..d38e9c03df 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java @@ -30,7 +30,6 @@ import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import com.thinkaurelius.titan.core.TitanVertex; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java index c3e88c85bf..08652ba171 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java @@ -20,7 +20,20 @@ package org.openecomp.sdc.be.dao.jsongraph.types; -import org.openecomp.sdc.be.datatypes.elements.*; +import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.CompositionDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapCapabiltyProperty; +import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListCapabiltyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; public enum VertexTypeEnum { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/utils/IdBuilderUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/utils/IdBuilderUtils.java index f4aff17ce6..7b0719e063 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/utils/IdBuilderUtils.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/utils/IdBuilderUtils.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.dao.jsongraph.utils; import java.util.UUID; + import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; public class IdBuilderUtils { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphEdgePropertiesDictionary.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphEdgePropertiesDictionary.java index 2af909ee0d..6bba5dac9d 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphEdgePropertiesDictionary.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphEdgePropertiesDictionary.java @@ -23,8 +23,6 @@ package org.openecomp.sdc.be.dao.neo4j; import java.util.ArrayList; import java.util.List; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; - public enum GraphEdgePropertiesDictionary { // field name class type diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/rest/HttpRestClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/rest/HttpRestClient.java index 91a984b7f2..563129937e 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/rest/HttpRestClient.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/rest/HttpRestClient.java @@ -27,7 +27,6 @@ import java.util.Properties; import org.apache.commons.io.IOUtils; import org.apache.http.HttpEntity; -import org.apache.http.HttpStatus; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGenericDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGenericDao.java index 8445d58873..8bd190f932 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGenericDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGenericDao.java @@ -29,15 +29,12 @@ import java.util.Map.Entry; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import javax.annotation.Resource; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Property; -import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.ElementHelper; import org.openecomp.sdc.be.config.ConfigurationManager; @@ -47,7 +44,6 @@ import org.openecomp.sdc.be.dao.graph.datatype.GraphElementTypeEnum; import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.graph.datatype.RelationEndPoint; -import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java index 07030472a4..edcf70f093 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/titan/TitanGraphClient.java @@ -21,11 +21,7 @@ package org.openecomp.sdc.be.dao.titan; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -37,23 +33,13 @@ import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct; import org.apache.commons.configuration.BaseConfiguration; -import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.DAOTitanStrategy; import org.openecomp.sdc.be.dao.TitanClientStrategy; -import org.openecomp.sdc.be.dao.graph.datatype.ActionEnum; -import org.openecomp.sdc.be.dao.graph.datatype.GraphElementTypeEnum; -import org.openecomp.sdc.be.dao.neo4j.GraphEdgePropertiesDictionary; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; -import org.openecomp.sdc.be.dao.utils.UserStatusEnum; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.resources.data.CategoryData; -import org.openecomp.sdc.be.resources.data.ResourceCategoryData; -import org.openecomp.sdc.be.resources.data.ServiceCategoryData; -import org.openecomp.sdc.be.resources.data.UserData; import org.openecomp.sdc.common.config.EcompErrorName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,7 +53,6 @@ import com.thinkaurelius.titan.core.SchemaViolationException; import com.thinkaurelius.titan.core.TitanConfigurationException; import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanGraphQuery; import com.thinkaurelius.titan.core.TitanVertex; import com.thinkaurelius.titan.core.TitanVertexProperty; import com.thinkaurelius.titan.core.schema.ConsistencyModifier; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/MapUtil.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/MapUtil.java index 84802ce293..e8b2e0c9ad 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/MapUtil.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/MapUtil.java @@ -20,8 +20,14 @@ package org.openecomp.sdc.be.dao.utils; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; /** * Utility class to ease map manipulation. @@ -62,6 +68,38 @@ public final class MapUtil { } } + /** + * + * @param valuesToMap the list of values to group + * @param groupingFunction the function to group the list values by + * @return a map of list of values grouped by a key, as specified in the {@code groupingFunction} + */ + public static Map> groupListBy(Collection valuesToMap, Function groupingFunction) { + return valuesToMap.stream().collect(Collectors.groupingBy(groupingFunction)); + } + + /** + * + * @param valuesToMap list of values to map + * @param mappingFunction a function which specifies how to map each element on the list + * @return a map created by mapping each element from the {@code valuesToMap} as specified in the {@code mappingFunction} + */ + public static Map toMap(Collection valuesToMap, Function mappingFunction) { + return Optional.ofNullable(valuesToMap).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(mappingFunction, Function.identity())); + } + + /** + * + * @param map the map of which it keys to convert + * @param keyMappingFunction a function which converts the key object + * @return a map with converted keys. + */ + public static Map> convertMapKeys(Map> map, Function keyMappingFunction) { + return map.entrySet().stream() + .collect(Collectors.toMap(entry -> keyMappingFunction.apply(entry.getKey()), + Map.Entry::getValue)); + } + /** * Create a new hash map and fills it from the given keys and values * (keys[index] -> values[index]. diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/api/IResourceUploader.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/api/IResourceUploader.java index 9eea2962e1..46599ed2d8 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/api/IResourceUploader.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/api/IResourceUploader.java @@ -20,13 +20,8 @@ package org.openecomp.sdc.be.resources.api; -import java.util.List; -import java.util.Map; - import org.openecomp.sdc.be.dao.api.ResourceUploadStatus; import org.openecomp.sdc.be.resources.data.ESArtifactData; -import org.openecomp.sdc.be.resources.data.ServiceArtifactsDataCollection; -import org.openecomp.sdc.be.resources.exception.ResourceDAOException; import fj.data.Either; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CapabilityInstData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CapabilityInstData.java index 4c9bf6767e..0b5da1217d 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CapabilityInstData.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/CapabilityInstData.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.resources.data; import java.lang.reflect.Type; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ComponentMetadataData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ComponentMetadataData.java index 7e084eb021..fb58e9abff 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ComponentMetadataData.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ComponentMetadataData.java @@ -28,8 +28,6 @@ import java.util.Map; import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import com.google.gson.reflect.TypeToken; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupInstanceData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupInstanceData.java index 7138fe5f72..88f7ad9342 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupInstanceData.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupInstanceData.java @@ -25,10 +25,8 @@ import java.util.Map; import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; -import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.GroupInstanceDataDefinition; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; public class GroupInstanceData extends GraphNode { diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntry.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntry.java index b64ef201dd..be3ace6420 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntry.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntry.java @@ -1,13 +1,12 @@ package org.openecomp.sdc.be.resources.data; +import java.util.Date; + import com.datastax.driver.mapping.annotations.ClusteringColumn; import com.datastax.driver.mapping.annotations.Column; import com.datastax.driver.mapping.annotations.PartitionKey; import com.datastax.driver.mapping.annotations.Table; -import java.math.BigInteger; -import java.util.Date; - @Table(keyspace = "sdcrepository", name = "migrationTasks") public class MigrationTaskEntry { diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java index 6936f4e5be..c7cdca0b9e 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java @@ -2,9 +2,6 @@ package org.openecomp.sdc.be.dao.cassandra; import java.util.List; -import javax.annotation.Generated; - -import org.apache.tinkerpop.gremlin.structure.T; import org.junit.Test; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java index f4f9fd5fc2..ed8e2a7776 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java @@ -1,13 +1,7 @@ package org.openecomp.sdc.be.dao.cassandra; import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.annotation.Generated; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.resources.data.ComponentCacheData; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java index 141aeebc5d..96e8a7e70b 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.dao.cassandra; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.resources.data.SdcSchemaFilesData; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java index f4844a9800..b3cb75fb89 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java @@ -1,11 +1,7 @@ package org.openecomp.sdc.be.dao.cassandra.schema; -import javax.annotation.Generated; - import org.junit.Test; -import com.datastax.driver.core.Cluster; - public class SdcSchemaUtilsTest { diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java index 3c891c97f3..b2fdc011f6 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.cassandra.schema; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ArtifactTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ArtifactTableDescriptionTest.java index e0e1adac6c..8e3e838ba1 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ArtifactTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ArtifactTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/AuthEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/AuthEventTableDescriptionTest.java index 95000492c0..fd7752774c 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/AuthEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/AuthEventTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java index 4f12640b1f..d5e5f8fc7d 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; -import java.util.Map; - -import javax.annotation.Generated; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescriptionTest.java index 72117731d0..bc97922b53 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ComponentCacheTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinitionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinitionTest.java index 61c1c17565..74ea99e2ec 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinitionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ConsumerEventTableDefinitionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDescTest.java index 430d408a72..ca1d767065 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDeployEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDownloadEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDownloadEventTableDescTest.java index 28fed8c6aa..a3e11bf1a5 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDownloadEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribDownloadEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribEngineEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribEngineEventTableDescTest.java index 6904aea64c..46eb0f590a 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribEngineEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribEngineEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribNotifEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribNotifEventTableDescTest.java index 97f587976e..4046a6101b 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribNotifEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribNotifEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java index e4defc068c..9cb7950c5f 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; -import java.util.Map; - -import javax.annotation.Generated; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDescTest.java index eb23b88363..2626536eed 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ExternalApiEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDescTest.java index ce858ee33f..9cc7a556a0 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetCatHierEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDescTest.java index 559c8c9280..d31cc59007 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUebClusterEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDescTest.java index 26a8788e5c..b7c217f588 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/GetUsersListEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescriptionTest.java index ad2b5c8a0d..f79b2759d6 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/MigrationTasksTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDescTest.java index 31ae8b5549..3cc4094d0f 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/OldExternalApiEventTableDescTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java index 6e6afb7424..0d9a4c24f3 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; -import java.util.Map; - -import javax.annotation.Generated; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/SdcSchemaFilesTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/SdcSchemaFilesTableDescriptionTest.java index b323c0fabe..e0e02b5d86 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/SdcSchemaFilesTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/SdcSchemaFilesTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAccessEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAccessEventTableDescriptionTest.java index da90309e34..1da6867d01 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAccessEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAccessEventTableDescriptionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java index 66f6861f83..2144e002d1 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.dao.cassandra.schema.tables; import java.util.List; -import java.util.Map; - -import javax.annotation.Generated; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java index 9a8b67dbd0..ae51f64d05 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java @@ -2,11 +2,8 @@ package org.openecomp.sdc.be.dao.jsongraph; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java index bf059219c2..0f6faaa02c 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java @@ -3,13 +3,8 @@ package org.openecomp.sdc.be.dao.jsongraph; import java.util.List; import java.util.Map; -import javax.annotation.Generated; -import javax.lang.model.element.Element; - -import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.EdgePropertyEnum; @@ -19,11 +14,7 @@ import org.openecomp.sdc.be.dao.titan.TitanGraphClient; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; -import com.datastax.driver.core.schemabuilder.SchemaBuilder.Direction; -import com.google.common.collect.Multiset.Entry; import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanGraphQuery; -import com.thinkaurelius.titan.core.TitanVertex; import fj.data.Either; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java index 6b50f6e806..0772ebb82d 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.jsongraph.types; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java index 544a9ce38b..9f556b04f8 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.jsongraph.types; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java index ed924bda04..db5ab71bca 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.jsongraph.types; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java index 18dffacfe2..79ee69bd8e 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/rest/RestConfigurationInfoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/rest/RestConfigurationInfoTest.java index 5ce78c2c95..63091f4412 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/rest/RestConfigurationInfoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/rest/RestConfigurationInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.rest; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/utils/MapEntryTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/utils/MapEntryTest.java index bb6afc4153..ee7f703187 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/utils/MapEntryTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/utils/MapEntryTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.dao.utils; -import javax.annotation.Generated; - import org.apache.tinkerpop.gremlin.structure.T; import org.elasticsearch.common.recycler.Recycler.V; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java index 06d26f79f9..1d0c9e0a89 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/AuditingDaoTest.java @@ -20,7 +20,18 @@ package org.openecomp.sdc.be.resources; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.annotation.Resource; + import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.index.query.MatchAllQueryBuilder; @@ -32,12 +43,17 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openecomp.sdc.be.config.Configuration; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.ElasticSearchConfig.IndicesTimeFrequencyEntry; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.es.ElasticSearchClient; import org.openecomp.sdc.be.dao.impl.AuditingDao; -import org.openecomp.sdc.be.resources.data.auditing.*; +import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionNotificationEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent; +import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent; +import org.openecomp.sdc.be.resources.data.auditing.UserAccessEvent; +import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; @@ -53,14 +69,7 @@ import org.springframework.test.context.support.DependencyInjectionTestExecution import org.springframework.test.context.support.DirtiesContextTestExecutionListener; import org.springframework.test.context.transaction.TransactionalTestExecutionListener; -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import static org.junit.Assert.*; +import fj.data.Either; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:application-context-test.xml") diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java index caaf0702a5..dbc246eb56 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/CassandraTest.java @@ -20,15 +20,15 @@ package org.openecomp.sdc.be.resources; +import org.openecomp.sdc.be.dao.Account; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; import com.datastax.driver.mapping.Mapper; import com.datastax.driver.mapping.MappingManager; -import org.openecomp.sdc.be.dao.Account; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class CassandraTest { private static Logger log = LoggerFactory.getLogger(CassandraTest.class.getName()); private Cluster cluster; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/JsonParserUtilsTests.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/JsonParserUtilsTests.java index 18254ac54c..cac429c6fb 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/JsonParserUtilsTests.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/JsonParserUtilsTests.java @@ -26,10 +26,7 @@ import java.util.Map; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.type.TypeReference; import org.junit.Test; -import org.openecomp.sdc.be.dao.jsongraph.utils.JsonParserUtils; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java index 97ccb43959..6dede29977 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/TitanGenericDaoTest.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.be.resources; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -73,8 +72,6 @@ import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; import com.thinkaurelius.titan.core.TitanVertex; import com.thinkaurelius.titan.core.attribute.Text; -import com.thinkaurelius.titan.core.schema.ConsistencyModifier; -import com.thinkaurelius.titan.core.schema.TitanGraphIndex; import com.thinkaurelius.titan.core.schema.TitanManagement; import fj.data.Either; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AdditionalInfoParameterDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AdditionalInfoParameterDataTest.java index 7624c059c9..d693bc075f 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AdditionalInfoParameterDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AdditionalInfoParameterDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ArtifactDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ArtifactDataTest.java index 4d6bfbf4cd..7419498e5a 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ArtifactDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ArtifactDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeDataTest.java index 4d684f7f46..f056d676d1 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeValueDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeValueDataTest.java index dcfdb52024..0ccd7a1b70 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeValueDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/AttributeValueDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityDataTest.java index 5e709812ac..1702ca4a32 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityDataTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityInstDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityInstDataTest.java index ca86edf0f2..88b46c9531 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityInstDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityInstDataTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityTypeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityTypeDataTest.java index 7d4cc5b29b..c737f5dfe6 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityTypeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/CapabilityTypeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.CapabilityTypeDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentCacheDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentCacheDataTest.java index 0c9ff52d69..7ea9683981 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentCacheDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentCacheDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Date; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentInstanceDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentInstanceDataTest.java index 761f113511..0e48444106 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentInstanceDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ComponentInstanceDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ConsumerDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ConsumerDataTest.java index 68dddbfe25..2071b19f62 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ConsumerDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ConsumerDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/DataTypeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/DataTypeDataTest.java index 5766b36e8b..3277a039ad 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/DataTypeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/DataTypeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupDataTest.java index 4095336e4c..072949a6ae 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupInstanceDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupInstanceDataTest.java index 99b54f7f42..a0d75fa3ed 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupInstanceDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupInstanceDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.GroupInstanceDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupTypeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupTypeDataTest.java index 070f2708e2..922a20aeb4 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupTypeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/GroupTypeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.GroupTypeDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterDataTest.java index db3db02c0b..066c5a4882 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterDataTest.java @@ -2,9 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterValueDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterValueDataTest.java index 55b4719b79..662664421d 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterValueDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/HeatParameterValueDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputValueDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputValueDataTest.java index 0099f9a149..f2d500366e 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputValueDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputValueDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputsDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputsDataTest.java index 193d53762a..49de163c59 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputsDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InputsDataTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InterfaceDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InterfaceDataTest.java index 59f28c860e..58c111c62e 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InterfaceDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/InterfaceDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntryTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntryTest.java index 45bd2e176c..178ac2a6a2 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntryTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/MigrationTaskEntryTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Date; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/OperationDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/OperationDataTest.java index 776c5c3909..88d53d368d 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/OperationDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/OperationDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PolicyTypeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PolicyTypeDataTest.java index c2551b0356..840a55b336 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PolicyTypeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PolicyTypeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PolicyTypeDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ProductMetadataDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ProductMetadataDataTest.java index 382ca38e86..7edc786f11 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ProductMetadataDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ProductMetadataDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyDataTest.java index ae582b7383..4533b53e84 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyDataTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyValueDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyValueDataTest.java index 1151a8387c..7bd7eaa4b5 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyValueDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/PropertyValueDataTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyRule; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipInstDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipInstDataTest.java index 81b6352b0a..1c550654f0 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipInstDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipInstDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipTypeDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipTypeDataTest.java index 3f06669e8e..6baf1a4ecf 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipTypeDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RelationshipTypeDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementDataTest.java index 8251fe82b7..580c9e5eb3 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementImplDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementImplDataTest.java index 9e917a1679..b9159c6868 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementImplDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/RequirementImplDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ResourceCategoryDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ResourceCategoryDataTest.java index feebd07947..e67fb8d92e 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ResourceCategoryDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ResourceCategoryDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/SdcSchemaFilesDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/SdcSchemaFilesDataTest.java index 0581412b3c..2f3fb03051 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/SdcSchemaFilesDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/SdcSchemaFilesDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Date; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceArtifactsDataCollectionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceArtifactsDataCollectionTest.java index 0afe7be7ef..3c498e87f4 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceArtifactsDataCollectionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceArtifactsDataCollectionTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; public class ServiceArtifactsDataCollectionTest { diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceMetadataDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceMetadataDataTest.java index d10db84409..929d82e442 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceMetadataDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ServiceMetadataDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserDataTest.java index b7c051567d..3aab39b8e9 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Assert; import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserFunctionalMenuDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserFunctionalMenuDataTest.java index fd493fa54e..9111d5cc61 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserFunctionalMenuDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/UserFunctionalMenuDataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.resources.data; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ConsumerEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ConsumerEventTest.java index 2b2bb4d5e9..1f8050907a 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ConsumerEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ConsumerEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDeployEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDeployEventTest.java index 2ea9bf9cf1..11c995716b 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDeployEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDeployEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDownloadEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDownloadEventTest.java index 7ab3d8ca1f..bf005c6d06 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDownloadEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionDownloadEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionEngineEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionEngineEventTest.java index e4450111c1..89b0ea2dba 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionEngineEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionEngineEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionNotificationEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionNotificationEventTest.java index 40a46c080b..c9934271ad 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionNotificationEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionNotificationEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; public class DistributionNotificationEventTest { diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionStatusEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionStatusEventTest.java index b776085746..04ebe334cf 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionStatusEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/DistributionStatusEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ExternalApiEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ExternalApiEventTest.java index d4988dae3c..58ef795885 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ExternalApiEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ExternalApiEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetCategoryHierarchyEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetCategoryHierarchyEventTest.java index e60747d7c9..c63c6a80cb 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetCategoryHierarchyEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetCategoryHierarchyEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetUsersListEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetUsersListEventTest.java index bd51b61d92..bde5ff7892 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetUsersListEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/GetUsersListEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ResourceAdminEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ResourceAdminEventTest.java index a840319367..49887fb1f9 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ResourceAdminEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/ResourceAdminEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAccessEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAccessEventTest.java index efdaeb06ab..f869bdb431 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAccessEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAccessEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAdminEventTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAdminEventTest.java index 4b66893821..532d31a5bc 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAdminEventTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/auditing/UserAdminEventTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.resources.data.auditing; import java.util.Date; import java.util.UUID; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java index 5424e712fc..71b7b4f245 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.resources.exception; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.dao.api.ResourceUploadStatus; diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml index d79d6aab47..b51ebd3087 100644 --- a/catalog-fe/pom.xml +++ b/catalog-fe/pom.xml @@ -293,8 +293,7 @@ org.mockito - mockito-all - ${mockito.version} + mockito-core test diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HttpRequestInfo.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HttpRequestInfo.java index 6a2a41fe1d..bf39a982c4 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HttpRequestInfo.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HttpRequestInfo.java @@ -21,10 +21,7 @@ package org.openecomp.sdc.fe.impl; import java.io.ByteArrayInputStream; -import java.io.IOException; import java.io.InputStream; -import java.util.Enumeration; -import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java index 21a41b6a7e..7010034214 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/HealthCheckService.java @@ -25,6 +25,7 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; @@ -42,19 +43,22 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.common.api.HealthCheckInfo; -import org.openecomp.sdc.common.api.HealthCheckWrapper; -import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; +import org.openecomp.sdc.common.api.HealthCheckWrapper; import org.openecomp.sdc.common.config.EcompErrorName; import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.util.HealthCheckUtil; import org.openecomp.sdc.fe.config.Configuration; import org.openecomp.sdc.fe.config.ConfigurationManager; import org.openecomp.sdc.fe.config.FeEcompErrorManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; public class HealthCheckService { @@ -74,7 +78,7 @@ public class HealthCheckService { private static Logger log = LoggerFactory.getLogger(HealthCheckService.class.getName()); private HealthStatus lastHealthStatus = new HealthStatus(500, "{}"); - private final List healthCheckFeComponents = Arrays.asList(HealthCheckComponent.ON_BOARDING); + private final List healthCheckFeComponents = Arrays.asList(Constants.HC_COMPONENT_ON_BOARDING, Constants.HC_COMPONENT_DCAE); private class HealthCheckScheduledTask implements Runnable { @Override @@ -134,34 +138,42 @@ public class HealthCheckService { httpClient = getHttpClient(config); HttpGet httpGet = new HttpGet(redirectedUrl); CloseableHttpResponse beResponse; - int beStatus; - String feAggHealthCheck; + HealthCheckWrapper feAggHealthCheck; try { beResponse = httpClient.execute(httpGet); - beStatus = beResponse.getStatusLine().getStatusCode(); + log.debug("HC call to BE - status code is {}", beResponse.getStatusLine().getStatusCode()); String beJsonResponse = EntityUtils.toString(beResponse.getEntity()); feAggHealthCheck = getFeHealthCheckInfos(gson, beJsonResponse); } catch (Exception e) { - log.error("Health Check error when trying to connect to BE", e); + log.debug("Health Check error when trying to connect to BE or external FE. Error: {}", e.getMessage()); + log.error("Health Check error when trying to connect to BE or external FE.", e); String beDowneResponse = gson.toJson(getBeDownCheckInfos()); - return new HealthStatus(500, beDowneResponse); + return new HealthStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR, beDowneResponse); } - return new HealthStatus(beStatus, feAggHealthCheck); + + //Getting aggregate FE status + boolean aggregateFeStatus = HealthCheckUtil.getAggregateStatus(feAggHealthCheck.getComponentsInfo()); + return new HealthStatus(aggregateFeStatus ? HttpStatus.SC_OK : HttpStatus.SC_INTERNAL_SERVER_ERROR, gson.toJson(feAggHealthCheck)); } catch (Exception e) { FeEcompErrorManager.getInstance().processEcompError(EcompErrorName.FeHealthCheckGeneralError, "Unexpected FE Health check error"); FeEcompErrorManager.getInstance().logFeHealthCheckGeneralError("Unexpected FE Health check error"); log.error("Unexpected FE health check error {}", e.getMessage()); - return new HealthStatus(500, e.getMessage()); + return new HealthStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); } finally { if (httpClient != null) { try { httpClient.close(); } catch (IOException e) { + log.error("Couldn't close HC HTTP Client: ", e); } } } } + + + + private Response buildResponse(int status, String jsonResponse) { healthLogger.trace("FE and BE health check status: {}", jsonResponse); return Response.status(status).entity(jsonResponse).build(); @@ -186,44 +198,56 @@ public class HealthCheckService { } - private String getFeHealthCheckInfos(Gson gson, String responseString) { + private HealthCheckWrapper getFeHealthCheckInfos(Gson gson, String responseString) { Type wrapperType = new TypeToken() { }.getType(); HealthCheckWrapper healthCheckWrapper = gson.fromJson(responseString, wrapperType); String appVersion = ExternalConfiguration.getAppVersion(); String description = "OK"; healthCheckWrapper.getComponentsInfo() - .add(new HealthCheckInfo(HealthCheckComponent.FE, HealthCheckStatus.UP, appVersion, description)); + .add(new HealthCheckInfo(Constants.HC_COMPONENT_FE, HealthCheckStatus.UP, appVersion, description)); //add hosted components fe component - for (HealthCheckComponent component: healthCheckFeComponents) { + for (String component: healthCheckFeComponents) { List feComponentsInfo = addHostedComponentsFeHealthCheck(component); - HealthCheckInfo baseComponentHCInfo = healthCheckWrapper.getComponentsInfo().stream().filter(c -> c.getHealthCheckComponent() == component).findFirst().orElse(null); + HealthCheckInfo baseComponentHCInfo = healthCheckWrapper.getComponentsInfo().stream().filter(c -> c.getHealthCheckComponent().equals(component)).findFirst().orElse(null); if (baseComponentHCInfo != null) { if (baseComponentHCInfo.getComponentsInfo() == null) { baseComponentHCInfo.setComponentsInfo(new ArrayList<>()); } baseComponentHCInfo.getComponentsInfo().addAll(feComponentsInfo); + boolean status = HealthCheckUtil.getAggregateStatus(baseComponentHCInfo.getComponentsInfo()); + baseComponentHCInfo.setHealthCheckStatus(status ? HealthCheckStatus.UP : HealthCheckStatus.DOWN); + + String componentsDesc = HealthCheckUtil.getAggregateDescription(baseComponentHCInfo.getComponentsInfo(), baseComponentHCInfo.getDescription()); + if (componentsDesc.length() > 0) { //aggregated description contains all the internal components desc + baseComponentHCInfo.setDescription(componentsDesc); + } + } else { + log.error("{} not exists in HealthCheck info", component); } } - return gson.toJson(healthCheckWrapper); + return healthCheckWrapper; } - private List addHostedComponentsFeHealthCheck(HealthCheckComponent baseComponent) { + private List addHostedComponentsFeHealthCheck(String baseComponent) { Configuration config = ((ConfigurationManager) context.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)) .getConfiguration(); String healthCheckUrl = null; switch(baseComponent) { - case ON_BOARDING: + case Constants.HC_COMPONENT_ON_BOARDING: healthCheckUrl = buildOnboardingHealthCheckUrl(config); break; + case Constants.HC_COMPONENT_DCAE: + healthCheckUrl = buildDcaeHealthCheckUrl(config); + break; } String description; if (healthCheckUrl != null) { - Gson gson = new Gson(); + ObjectMapper mapper = new ObjectMapper(); CloseableHttpClient httpClient = getHttpClient(config); HttpGet httpGet = new HttpGet(healthCheckUrl); CloseableHttpResponse beResponse; @@ -232,32 +256,45 @@ public class HealthCheckService { beResponse = httpClient.execute(httpGet); int beStatus = beResponse.getStatusLine().getStatusCode(); if (beStatus == HttpStatus.SC_OK || beStatus == HttpStatus.SC_INTERNAL_SERVER_ERROR) { - String beJsonResponse = EntityUtils.toString(beResponse.getEntity()); - HealthCheckWrapper healthCheckWrapper = gson.fromJson(beJsonResponse, HealthCheckWrapper.class); - return healthCheckWrapper.getComponentsInfo(); + try { + String beJsonResponse = EntityUtils.toString(beResponse.getEntity()); + + Map healthCheckMap = mapper.readValue(beJsonResponse, new TypeReference>(){}); + if (healthCheckMap.containsKey("componentsInfo")) { + List componentsInfo = mapper.convertValue(healthCheckMap.get("componentsInfo"), new TypeReference>() {}); + return componentsInfo; + } else { + description = "Internal components are missing"; + } + } catch (JsonSyntaxException e) { + log.error("{} Unexpected response body ", baseComponent, e); + description = baseComponent + " Unexpected response body. Response code: " + beStatus; + } } else { description = "Response code: " + beStatus; + log.trace("{} Health Check Response code: {}", baseComponent, beStatus); } } catch (Exception e) { - log.error("Health Check error when trying to connect to " + baseComponent, e); - description = e.getMessage(); + log.error("{} Unexpected response ", baseComponent, e); + description = baseComponent + " Unexpected response: " + e.getMessage(); } } else { - description = "Incorrect Health Check Url"; + description = baseComponent + " health check Configuration is missing"; } - return Arrays.asList(new HealthCheckInfo(HealthCheckComponent.FE, HealthCheckStatus.DOWN, null, description)); + return Arrays.asList(new HealthCheckInfo(Constants.HC_COMPONENT_FE, HealthCheckStatus.DOWN, null, description)); } private HealthCheckWrapper getBeDownCheckInfos() { List healthCheckInfos = new ArrayList(); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.FE, HealthCheckStatus.UP, + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_FE, HealthCheckStatus.UP, ExternalConfiguration.getAppVersion(), "OK")); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.BE, HealthCheckStatus.DOWN, null, null)); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.TITAN, HealthCheckStatus.UNKNOWN, null, null)); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.CASSANDRA, HealthCheckStatus.UNKNOWN, null, null)); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.UNKNOWN, null, null)); - healthCheckInfos.add(new HealthCheckInfo(HealthCheckComponent.ON_BOARDING, HealthCheckStatus.UNKNOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_BE, HealthCheckStatus.DOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_TITAN, HealthCheckStatus.UNKNOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_CASSANDRA, HealthCheckStatus.UNKNOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckStatus.UNKNOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_ON_BOARDING, HealthCheckStatus.UNKNOWN, null, null)); + healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_DCAE, HealthCheckStatus.UNKNOWN, null, null)); HealthCheckWrapper hcWrapper = new HealthCheckWrapper(healthCheckInfos, "UNKNOWN", "UNKNOWN"); return hcWrapper; } @@ -277,11 +314,33 @@ public class HealthCheckService { Configuration.OnboardingConfig onboardingConfig = config.getOnboarding(); - String protocol = onboardingConfig.getProtocol(); - String host = onboardingConfig.getHost(); - Integer port = onboardingConfig.getPort(); - String uri = onboardingConfig.getHealthCheckUri(); + if (onboardingConfig != null) { + String protocol = onboardingConfig.getProtocol(); + String host = onboardingConfig.getHost(); + Integer port = onboardingConfig.getPort(); + String uri = onboardingConfig.getHealthCheckUri(); + + return protocol + "://" + host + ":" + port + uri; + } + + log.error("onboarding health check configuration is missing."); + return null; + } + + private String buildDcaeHealthCheckUrl(Configuration config) { + + Configuration.DcaeConfig dcaeConfig = config.getDcae(); + + if (dcaeConfig != null) { + String protocol = dcaeConfig.getProtocol(); + String host = dcaeConfig.getHost(); + Integer port = dcaeConfig.getPort(); + String uri = dcaeConfig.getHealthCheckUri(); + + return protocol + "://" + host + ":" + port + uri; + } - return protocol + "://" + host + ":" + port + uri; + log.error("dcae health check configuration is missing."); + return null; } } diff --git a/catalog-fe/src/main/resources/config/configuration.yaml b/catalog-fe/src/main/resources/config/configuration.yaml index 1eda94b178..0636e701af 100644 --- a/catalog-fe/src/main/resources/config/configuration.yaml +++ b/catalog-fe/src/main/resources/config/configuration.yaml @@ -32,6 +32,12 @@ onboarding: port: 8181 healthCheckUri: "/onboarding/v1.0/healthcheck" +dcae: + protocol: http + host: localhost + port: 8181 + healthCheckUri: "/dcae/healthCheck" + identificationHeaderFields: - - &HTTP_IV_USER HTTP_IV_USER diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java index b91048dfa1..685d6b3d8f 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java @@ -1,10 +1,6 @@ package org.openecomp.sdc.fe; -import javax.annotation.Generated; -import javax.servlet.FilterChain; import javax.servlet.FilterConfig; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; import org.junit.Test; diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java index d851899f59..943385bb7f 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java @@ -1,16 +1,8 @@ package org.openecomp.sdc.fe.client; -import java.util.List; - -import javax.annotation.Generated; import javax.net.ssl.HostnameVerifier; -import javax.ws.rs.container.AsyncResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.eclipse.jetty.http.HttpGenerator.ResponseInfo; import org.junit.Test; -import org.openecomp.sdc.fe.impl.HttpRequestInfo; public class BackendClientTest { diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java index a6885bfe1b..c77206fb03 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.fe.listen; -import javax.annotation.Generated; - import org.junit.Test; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java index 25a7c6962d..c400ba2da3 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java @@ -1,15 +1,9 @@ package org.openecomp.sdc.fe.servlets; -import java.util.List; - -import javax.annotation.Generated; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Test; -import org.openecomp.sdc.common.impl.MutableHttpServletRequest; - -import io.netty.handler.codec.http2.Http2FrameReader.Configuration; public class PortalServletTest { diff --git a/catalog-model/.gitignore b/catalog-model/.gitignore deleted file mode 100644 index d9d66d8144..0000000000 --- a/catalog-model/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target -/bin/ diff --git a/catalog-model/pom.xml b/catalog-model/pom.xml index 8d9a7c092d..e3a677d79e 100644 --- a/catalog-model/pom.xml +++ b/catalog-model/pom.xml @@ -12,8 +12,11 @@ 1.2.0-SNAPSHOT - + + true + + org.openecomp.sdc @@ -178,8 +181,7 @@ org.mockito - mockito-all - ${mockito.version} + mockito-core test diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityDefinition.java index 548f72df9c..ccc52480b8 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityDefinition.java @@ -23,9 +23,9 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; /** * Specifies the capabilities that the Node Type exposes. @@ -59,7 +59,7 @@ public class CapabilityDefinition extends CapabilityDataDefinition implements Se super((CapabilityDefinition)other); if (other.properties != null) { - this.properties = new ArrayList<>(other.properties); + this.properties = new ArrayList<>(other.properties.stream().map(p -> new ComponentInstanceProperty(p)).collect(Collectors.toList())); } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityRequirementRelationship.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityRequirementRelationship.java new file mode 100644 index 0000000000..54b998d0dd --- /dev/null +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/CapabilityRequirementRelationship.java @@ -0,0 +1,39 @@ +package org.openecomp.sdc.be.model; + +import java.io.Serializable; + +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; +/** + * Contains the Capability, Requirement and Relationship info + */ +public class CapabilityRequirementRelationship implements Serializable { + + private static final long serialVersionUID = 1L; + + private RelationshipInfo relation; + private CapabilityDataDefinition capability; + private RequirementDataDefinition requirement; + + public RelationshipInfo getRelation() { + return relation; + } + public void setRelation(RelationshipInfo relation) { + this.relation = relation; + } + public CapabilityDataDefinition getCapability() { + return capability; + } + public void setCapability(CapabilityDataDefinition capability) { + this.capability = capability; + } + public RequirementDataDefinition getRequirement() { + return requirement; + } + public void setRequirement(RequirementDataDefinition requirement) { + this.requirement = requirement; + } + public static long getSerialversionuid() { + return serialVersionUID; + } +} diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java index 9ffefa6384..5760e0b11b 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java @@ -28,12 +28,14 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.stream.Collectors; import org.codehaus.jackson.annotate.JsonIgnore; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; +import org.openecomp.sdc.common.api.ArtifactTypeEnum; public abstract class Component implements Serializable { @@ -342,6 +344,27 @@ public abstract class Component implements Serializable { return componentInstances; } + public Map safeGetComponentInstanceDeploymentArtifacts(String componentInstanceId) { + Optional componentInstanceById = getComponentInstanceById(componentInstanceId); + Map instanceDeploymentArtifacts = componentInstanceById.get().safeGetDeploymentArtifacts(); + return instanceDeploymentArtifacts != null ? instanceDeploymentArtifacts : Collections.EMPTY_MAP; + } + + public Map safeGetComponentInstanceInformationalArtifacts(String componentInstanceId) { + Optional componentInstanceById = getComponentInstanceById(componentInstanceId); + Map instanceInformationalArtifacts = componentInstanceById.get().safeGetInformationalArtifacts(); + return instanceInformationalArtifacts != null ? instanceInformationalArtifacts : Collections.EMPTY_MAP; + } + + public List safeGetComponentInstanceHeatArtifacts(String componentInstanceId) { + Optional componentInstanceById = getComponentInstanceById(componentInstanceId); + List instanceHeatEnvArtifacts = Optional.ofNullable(componentInstanceById.get().safeGetDeploymentArtifacts().values()).orElse(new ArrayList()) + .stream() + .filter(artifact -> artifact.getArtifactType() != null && artifact.getArtifactType().equals(ArtifactTypeEnum.HEAT_ENV.name())) + .collect(Collectors.toList()); + return instanceHeatEnvArtifacts == null ? Collections.EMPTY_LIST : instanceHeatEnvArtifacts; + } + public void setComponentInstances(List resourceInstances) { this.componentInstances = resourceInstances; } @@ -358,6 +381,14 @@ public abstract class Component implements Serializable { return componentInstancesProperties; } + public List safeGetComponentInstanceProperties(String cmptInstacneId) { + return this.safeGetComponentInstanceEntity(cmptInstacneId, this.componentInstancesProperties); + } + + public List safeGetComponentInstanceInput(String comptInstanceId) { + return this.safeGetComponentInstanceEntity(comptInstanceId, this.componentInstancesInputs); + } + public void setComponentInstancesProperties( Map> resourceInstancesProperties) { this.componentInstancesProperties = resourceInstancesProperties; @@ -411,6 +442,10 @@ public abstract class Component implements Serializable { componentMetadataDefinition.getMetadataDataDefinition().setInvariantUUID(invariantUUID); } + public Optional getComponentInstanceById(String id) { + return componentInstances.stream().filter(instance -> id.equals(instance.getUniqueId())).findFirst(); + } + public List getGroups() { return groups; } @@ -632,6 +667,30 @@ public abstract class Component implements Serializable { return componentInstancesInputs; } + public List safeGetComponentInstanceInputsByName(String cmptInstanceName) { + List emptyPropsList = Collections.emptyList(); + if (this.componentInstancesInputs == null) { + return emptyPropsList; + } + Optional> instanceInputsByName = this.componentInstances.stream() + .filter(ci -> ci.getName().equals(cmptInstanceName)) + .map(ComponentInstance::getUniqueId) + .map(instanceId -> safeGetComponentInstanceEntity(instanceId, this.componentInstancesInputs)) + .findAny(); + return instanceInputsByName.orElse(emptyPropsList); + } + + private List safeGetComponentInstanceEntity(String cmptInstanceId, Map> instanceEntities) { + List emptyPropsList = Collections.emptyList(); + if (instanceEntities == null) { + return emptyPropsList; + } + List cmptInstanceProps = instanceEntities.get(cmptInstanceId); + return cmptInstanceProps == null ? emptyPropsList : cmptInstanceProps; + } + + + public void setComponentInstancesInputs(Map> componentInstancesInputs) { this.componentInstancesInputs = componentInstancesInputs; } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstance.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstance.java index 0b7e523813..8ed256c555 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstance.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstance.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -67,6 +68,14 @@ public class ComponentInstance extends ComponentInstanceDataDefinition implement return deploymentArtifacts; } + public Map safeGetDeploymentArtifacts() { + return deploymentArtifacts == null ? Collections.EMPTY_MAP : deploymentArtifacts; + } + + public Map safeGetInformationalArtifacts() { + return artifacts == null ? Collections.EMPTY_MAP : deploymentArtifacts; + } + public void setDeploymentArtifacts(Map deploymentArtifacts) { this.deploymentArtifacts = deploymentArtifacts; } @@ -75,6 +84,10 @@ public class ComponentInstance extends ComponentInstanceDataDefinition implement return artifacts; } + public Map safeGetArtifacts() { + return artifacts == null ? Collections.EMPTY_MAP : artifacts; + } + public void setArtifacts(Map artifacts) { this.artifacts = artifacts; } @@ -86,5 +99,9 @@ public class ComponentInstance extends ComponentInstanceDataDefinition implement public void setGroupInstances(List groupInstances) { this.groupInstances = groupInstances; } + + public String getActualComponentUid() { + return getIsProxy() ? getSourceModelUid() : getComponentUid(); + } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstancePropInput.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstancePropInput.java index 9f5e3e9eea..ace83812ab 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstancePropInput.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentInstancePropInput.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; -import java.util.Map; public class ComponentInstancePropInput extends ComponentInstanceProperty implements Serializable{ /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java index 972884682e..a9cc32d9b0 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java @@ -24,8 +24,6 @@ import java.util.List; import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition; -import com.fasterxml.jackson.annotation.JsonIgnore; - public class DataTypeDefinition extends DataTypeDataDefinition { // @JsonIgnore diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DerivedNodeTypeResolver.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DerivedNodeTypeResolver.java index f841fcb6da..0e30211454 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DerivedNodeTypeResolver.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DerivedNodeTypeResolver.java @@ -20,13 +20,12 @@ package org.openecomp.sdc.be.model; -import fj.data.Either; +import java.util.List; + import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import java.util.List; +import fj.data.Either; public interface DerivedNodeTypeResolver { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupInstance.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupInstance.java index f0e08b85fd..e7d7c69efc 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupInstance.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupInstance.java @@ -23,6 +23,7 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; import java.util.List; import java.util.stream.Collectors; + import org.openecomp.sdc.be.datatypes.elements.GroupInstanceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupProperty.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupProperty.java index d8589d51b9..649aa1f710 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupProperty.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/GroupProperty.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model; -import org.apache.commons.lang.StringUtils; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; public class GroupProperty extends PropertyDefinition { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java index fb5943e1bd..afd555ee91 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.be.model; +import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType; + /** * Specifies an implementation artifact for interfaces or operations of a * {@link NodeType node type} or {@link RelationshipType relation type}. diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java index 8897d6ed4e..5eb5e8c05c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java @@ -21,12 +21,10 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; -import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; import org.codehaus.jackson.annotate.JsonIgnore; -import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java index 34ecdbf06d..6292218837 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; import java.util.List; + import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyValueDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyValueDefinition.java index 0264262ab3..bc22e55923 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyValueDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyValueDefinition.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.model; import org.openecomp.sdc.be.datatypes.elements.InputsValueDataDefinition; -import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; public class PropertyValueDefinition extends InputsValueDataDefinition implements IOperationParameter { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPair.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/RelationshipInfo.java similarity index 88% rename from catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPair.java rename to catalog-model/src/main/java/org/openecomp/sdc/be/model/RelationshipInfo.java index a3e4f48c51..02c9f70236 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPair.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/RelationshipInfo.java @@ -24,11 +24,8 @@ import java.io.Serializable; import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition; -public class RequirementAndRelationshipPair implements Serializable { +public class RelationshipInfo implements Serializable { - /** - * - */ private static final long serialVersionUID = -5763126570618602135L; private String requirement; @@ -43,17 +40,17 @@ public class RequirementAndRelationshipPair implements Serializable { private String capabilityUid; private String requirementUid; - public RequirementAndRelationshipPair() { + public RelationshipInfo() { super(); } - public RequirementAndRelationshipPair(String requirement, RelationshipImpl relationship) { + public RelationshipInfo(String requirement, RelationshipImpl relationship) { super(); this.requirement = requirement; this.relationship = relationship; } - public RequirementAndRelationshipPair(String requirement, RelationshipImpl relationship, String capability) { + public RelationshipInfo(String requirement, RelationshipImpl relationship, String capability) { super(); this.requirement = requirement; this.relationship = relationship; @@ -134,9 +131,16 @@ public class RequirementAndRelationshipPair implements Serializable { if ( savedRelation == null ){ return false; } - if ( !savedRelation.getType().equals(this.getRelationship().getType()) ){ - return false; - } + if(getRelationship().getType() == null ){ + if(savedRelation.getType() != null){ + return false; + } + } + else { + if ( !savedRelation.getType().equals(this.getRelationship().getType()) ){ + return false; + } + } if ( !savedRelation.getCapabilityOwnerId().equals(this.getCapabilityOwnerId()) ){ return false; } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Resource.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Resource.java index 45fc5f62b3..d48718bbff 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Resource.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Resource.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.be.dao.utils.MapUtil; import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; @@ -299,5 +300,15 @@ public class Resource extends Component implements Serializable { public boolean deriveFromGeneric(){ return this.shouldGenerateInputs() || (derivedFrom != null && derivedFrom.contains(fetchGenericTypeToscaNameFromConfig())); } - + + public Map> groupRelationsByInstanceName(Resource resource) { + Map> relationsByInstanceId = MapUtil.groupListBy(resource.getComponentInstancesRelations(), RequirementCapabilityRelDef::getFromNode); + return MapUtil.convertMapKeys(relationsByInstanceId, (instId) -> getInstanceNameFromInstanceId(resource, instId)); + } + + private String getInstanceNameFromInstanceId(Resource resource, String instId) { + return resource.getComponentInstanceById(instId).get().getName(); + } + + } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Service.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Service.java index cdd171184c..563030e147 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Service.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Service.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.model; import java.util.Map; + import org.openecomp.sdc.be.datatypes.components.ServiceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum; @@ -89,7 +90,13 @@ public class Service extends Component { public String getNamingPolicy() { return getServiceMetadataDefinition().getNamingPolicy(); } - + + public String getEnvironmentContext() { return getServiceMetadataDefinition().getEnvironmentContext(); } + + public void setEnvironmentContext(String environmentContext) { + getServiceMetadataDefinition().setEnvironmentContext(environmentContext); + } + public void setServiceType(String serviceType){ getServiceMetadataDefinition().setServiceType(serviceType); } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/TargetCapabilityRelDef.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/TargetCapabilityRelDef.java index f30ef353b1..6a1fcac7e8 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/TargetCapabilityRelDef.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/TargetCapabilityRelDef.java @@ -33,15 +33,13 @@ public class TargetCapabilityRelDef implements Serializable { private String uid; private String toNode; - // private List> relationships; - - private List relationships; + private List relationships; public TargetCapabilityRelDef() { super(); } - public TargetCapabilityRelDef(String toNode, List relationships) { + public TargetCapabilityRelDef(String toNode, List relationships) { super(); this.toNode = toNode; this.relationships = relationships; @@ -63,10 +61,15 @@ public class TargetCapabilityRelDef implements Serializable { // this.capabilityOwnerId = capabilityOwnerId; // } - public List getRelationships() { + public List getRelationships() { return relationships; } + + public CapabilityRequirementRelationship getSingleRelationship() {//currently only single relationship is supported + return relationships == null || relationships.isEmpty() ? null : relationships.get(0); + } + public String getUid() { return uid; } @@ -75,7 +78,7 @@ public class TargetCapabilityRelDef implements Serializable { this.uid = uid; } - public void setRelationships(List relationships) { + public void setRelationships(List relationships) { this.relationships = relationships; } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadPropInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadPropInfo.java index 5640f5582c..2683407fa2 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadPropInfo.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadPropInfo.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import java.util.Map; import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadReqInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadReqInfo.java index 7f2834bddf..e2a6c3c662 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadReqInfo.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadReqInfo.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.be.model; -import java.util.Map; - public class UploadReqInfo extends UploadInfo { /** * specify the node type(Optional by tosca) diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ComponentCache.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ComponentCache.java index cb85deeb2d..22b46a0458 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ComponentCache.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ComponentCache.java @@ -39,11 +39,11 @@ import javax.annotation.PostConstruct; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.Configuration; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; +import org.openecomp.sdc.be.config.Configuration; import org.openecomp.sdc.be.config.Configuration.ApplicationL1CacheCatalogInfo; import org.openecomp.sdc.be.config.Configuration.ApplicationL2CacheConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus; import org.openecomp.sdc.be.dao.cassandra.ComponentCassandraDao; @@ -58,7 +58,6 @@ import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.model.operations.impl.*; import org.openecomp.sdc.be.resources.data.ComponentCacheData; import org.openecomp.sdc.common.util.SerializationUtils; import org.openecomp.sdc.common.util.ZipUtil; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/CheckAndUpdateJob.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/CheckAndUpdateJob.java index dfc39042bd..ff1c21c7bd 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/CheckAndUpdateJob.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/CheckAndUpdateJob.java @@ -20,7 +20,8 @@ package org.openecomp.sdc.be.model.cache.jobs; -import fj.data.Either; +import java.util.function.Function; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; @@ -31,7 +32,7 @@ import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.function.Function; +import fj.data.Either; /** * Created by mlando on 9/7/2016. diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/DeleteJob.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/DeleteJob.java index ac1a56f9db..20dd4141f9 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/DeleteJob.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/DeleteJob.java @@ -20,13 +20,9 @@ package org.openecomp.sdc.be.model.cache.jobs; -import fj.data.Either; - import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.cache.DaoInfo; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/Job.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/Job.java index 198325b6b5..f701aaf661 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/Job.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/Job.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.be.model.cache.jobs; -import fj.data.Either; - import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.Component; @@ -31,6 +29,8 @@ import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import fj.data.Either; + public abstract class Job { private static Logger log = LoggerFactory.getLogger(Job.class.getName()); protected DaoInfo daoInfo; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/OverrideJob.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/OverrideJob.java index 47edae8968..641d125122 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/OverrideJob.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/jobs/OverrideJob.java @@ -20,8 +20,6 @@ package org.openecomp.sdc.be.model.cache.jobs; -import fj.data.Either; - import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.cache.DaoInfo; @@ -29,6 +27,8 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import fj.data.Either; + /** * Created by mlando on 9/20/2016. */ diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/CacheWorker.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/CacheWorker.java index 7d6ff49507..d29ade9c95 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/CacheWorker.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/CacheWorker.java @@ -20,15 +20,14 @@ package org.openecomp.sdc.be.model.cache.workers; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + import org.openecomp.sdc.be.model.cache.jobs.Job; -import org.openecomp.sdc.be.model.cache.workers.IWorker; import org.openecomp.sdc.be.workers.Worker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - /** * Created by mlando on 9/6/2016. the class represents a worker the pull job * from a queue and evacuates them. diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/SyncWorker.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/SyncWorker.java index 824dd3496f..64cc1c8eea 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/SyncWorker.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/workers/SyncWorker.java @@ -20,7 +20,11 @@ package org.openecomp.sdc.be.model.cache.workers; -import fj.data.Either; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; @@ -33,8 +37,7 @@ import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.*; -import java.util.stream.Collectors; +import fj.data.Either; /** * the class creates a worker that is used to update cache date, in case of diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/heat/HeatParameterType.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/heat/HeatParameterType.java index 5fbeb4f808..7f02684825 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/heat/HeatParameterType.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/heat/HeatParameterType.java @@ -20,14 +20,12 @@ package org.openecomp.sdc.be.model.heat; -import org.openecomp.sdc.be.model.tosca.converters.DefaultConverter; import org.openecomp.sdc.be.model.tosca.converters.HeatBooleanConverter; import org.openecomp.sdc.be.model.tosca.converters.HeatCommaDelimitedListConverter; import org.openecomp.sdc.be.model.tosca.converters.HeatJsonConverter; import org.openecomp.sdc.be.model.tosca.converters.HeatNumberConverter; import org.openecomp.sdc.be.model.tosca.converters.HeatStringConverter; import org.openecomp.sdc.be.model.tosca.converters.PropertyValueConverter; -import org.openecomp.sdc.be.model.tosca.converters.StringConvertor; import org.openecomp.sdc.be.model.tosca.validators.HeatBooleanValidator; import org.openecomp.sdc.be.model.tosca.validators.HeatCommaDelimitedListValidator; import org.openecomp.sdc.be.model.tosca.validators.HeatNumberValidator; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java index 07c2f8d51c..706007bdd7 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java @@ -67,7 +67,11 @@ public class ArtifactsOperations extends BaseOperation { public Either addArifactToComponent(ArtifactDefinition artifactInfo, String parentId, NodeTypeEnum type, boolean failIfExist, String instanceId) { - Either status = updateArtifactOnGraph(parentId, artifactInfo, type, artifactInfo.getUniqueId(), instanceId, false); + String artifactId = artifactInfo.getUniqueId(); + if (artifactId == null && artifactInfo.getEsId()!=null) { + artifactId = artifactInfo.getEsId(); + } + Either status = updateArtifactOnGraph(parentId, artifactInfo, type, artifactId, instanceId, false, false); if (status.isRight()) { log.debug("Failed to update artifact {} of {} {}. status is {}", artifactInfo.getArtifactName(), type.getName(), parentId, status.right().value()); @@ -86,7 +90,7 @@ public class ArtifactsOperations extends BaseOperation { public Either updateArifactOnResource(ArtifactDefinition artifactInfo, String id, String artifactId, NodeTypeEnum type, String instanceId) { - Either status = updateArtifactOnGraph(id, artifactInfo, type, artifactId, instanceId, true); + Either status = updateArtifactOnGraph(id, artifactInfo, type, artifactId, instanceId, true, false); if (status.isRight()) { log.debug("Failed to update artifact {} of {} {}. status is {}", artifactInfo.getArtifactName(), type.getName(), id, status.right().value()); @@ -269,8 +273,6 @@ public class ArtifactsOperations extends BaseOperation { } else { updateVersionAndDate(artifactData, oldVesrion); } - long time = System.currentTimeMillis(); - artifactData.setHeatParamsUpdateDate(time); break; case HEAT: case HEAT_NET: @@ -481,7 +483,7 @@ public class ArtifactsOperations extends BaseOperation { } - public Either updateArtifactOnGraph(String componentId, ArtifactDefinition artifactInfo, NodeTypeEnum type, String artifactId, String instanceId, boolean isUpdate) { + public Either updateArtifactOnGraph(String componentId, ArtifactDefinition artifactInfo, NodeTypeEnum type, String artifactId, String instanceId, boolean isUpdate, boolean isDeletePlaceholder) { Either res = null; ArtifactDataDefinition artifactToUpdate = new ArtifactDataDefinition(artifactInfo); ArtifactGroupTypeEnum groupType = artifactInfo.getArtifactGroupType(); @@ -506,7 +508,8 @@ public class ArtifactsOperations extends BaseOperation { uniqueId = UniqueIdBuilder.buildPropertyUniqueId(instanceId, artifactToUpdate.getArtifactLabel()); } artifactToUpdate.setUniqueId(uniqueId); - artifactToUpdate.setEsId(uniqueId); + if(!isDeletePlaceholder) + artifactToUpdate.setEsId(uniqueId); } else artifactToUpdate.setUniqueId(artifactId); @@ -552,7 +555,8 @@ public class ArtifactsOperations extends BaseOperation { String id = type != NodeTypeEnum.ResourceInstance ? componentId : instanceId; String uniqueId = UniqueIdBuilder.buildPropertyUniqueId(id, artifactToUpdate.getArtifactLabel()); artifactToUpdate.setUniqueId(uniqueId); - artifactToUpdate.setEsId(uniqueId); + if(!isDeletePlaceholder) + artifactToUpdate.setEsId(uniqueId); artifactToUpdate.setDuplicated(Boolean.FALSE); } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java index 79360f6e10..537198d395 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; @@ -90,6 +89,9 @@ public abstract class BaseOperation { @Autowired protected TopologyTemplateOperation topologyTemplateOperation; + public void setTitanDao(TitanDao titanDao) { + this.titanDao = titanDao; + } /** * Returns reference to appropriate toscaTemplateOperation * diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ByToscaNameDerivedNodeTypeResolver.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ByToscaNameDerivedNodeTypeResolver.java index 1afb43c132..5e5ee63a59 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ByToscaNameDerivedNodeTypeResolver.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ByToscaNameDerivedNodeTypeResolver.java @@ -20,7 +20,10 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; @@ -32,9 +35,7 @@ import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import fj.data.Either; @Component("derived-resource-resolver") public class ByToscaNameDerivedNodeTypeResolver implements DerivedNodeTypeResolver { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/GroupsOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/GroupsOperation.java index f7e4245492..87053ff454 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/GroupsOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/GroupsOperation.java @@ -20,7 +20,12 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; @@ -46,11 +51,7 @@ import org.openecomp.sdc.common.jsongraph.util.CommonUtility.LogLevelEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; +import fj.data.Either; @org.springframework.stereotype.Component("groups-operation") public class GroupsOperation extends BaseOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperation.java index 7ff42ae42e..f59f097bdb 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperation.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.model.jsontitan.operations; import java.util.ArrayList; +import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -30,6 +31,8 @@ import java.util.Map.Entry; import java.util.Optional; import java.util.Set; import java.util.UUID; +import java.util.function.BiConsumer; +import java.util.function.BiPredicate; import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; @@ -59,21 +62,27 @@ import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapListCapabiltyDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition; import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupInstance; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType; @@ -138,6 +147,7 @@ public class NodeTemplateOperation extends BaseOperation { } if (result == null) { + newInstanceNameRes = buildValidateInstanceName(container, originToscaElement, componentInstance, instanceNumberSuffix); if (newInstanceNameRes.isRight()) { result = Either.right(newInstanceNameRes.right().value()); @@ -154,6 +164,14 @@ public class NodeTemplateOperation extends BaseOperation { status = StorageOperationStatus.INVALID_ID; } result = Either.right(status); + } + if(componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy){ + TopologyTemplate updatedContainer = addComponentInstanceRes.left().value(); + result = addServerCapAndReqToProxyServerInstance( + updatedContainer, componentInstance, componentInstanceData); + + + } } if (result == null) { @@ -162,11 +180,130 @@ public class NodeTemplateOperation extends BaseOperation { return result; } + private Either, StorageOperationStatus> addServerCapAndReqToProxyServerInstance(TopologyTemplate updatedContainer, ComponentInstance componentInstance, + + ComponentInstanceDataDefinition componentInstanceData) { + + Either, StorageOperationStatus> result; + + + Map calcCap = updatedContainer.getCalculatedCapabilities(); + Map calcReg = updatedContainer.getCalculatedRequirements(); + Map calcCapProp = updatedContainer.getCalculatedCapabilitiesProperties(); + + + Map> additionalCap = componentInstance.getCapabilities(); + Map> additionalReq = componentInstance.getRequirements(); + + MapListCapabiltyDataDefinition allCalculatedCap = calcCap==null ||!calcCap.containsKey(componentInstanceData.getUniqueId())?new MapListCapabiltyDataDefinition() :calcCap.get(componentInstanceData.getUniqueId()); + /********capability****************************/ + StorageOperationStatus status = deleteToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_CAPABILITIES, VertexTypeEnum.CALCULATED_CAPABILITIES, componentInstanceData.getUniqueId()); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to remove calculated capabilty for instance {} in container {}. error {] ", componentInstanceData.getUniqueId(), updatedContainer.getUniqueId(), status); + return Either.right(status); + } + + if(additionalCap != null && !additionalCap.isEmpty()){ + + Map serverCap = additionalCap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, en -> new ListCapabilityDataDefinition(en.getValue().stream().map(iCap -> new CapabilityDataDefinition(iCap)).collect(Collectors.toList())))); + + serverCap.entrySet().forEach(entryPerType -> { + entryPerType.getValue().getListToscaDataDefinition().forEach(cap -> { + cap.addToPath(componentInstance.getUniqueId()); + allCalculatedCap.add(entryPerType.getKey(), cap); + }); + }); + + status = addToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_CAPABILITIES, VertexTypeEnum.CALCULATED_CAPABILITIES, allCalculatedCap, + componentInstance.getUniqueId()); + + /********capability property****************************/ + status = deleteToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_CAP_PROPERTIES, VertexTypeEnum.CALCULATED_CAP_PROPERTIES, componentInstanceData.getUniqueId()); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to remove calculated capabilty properties for instance {} in container {}. error {] ", componentInstanceData.getUniqueId(), updatedContainer.getUniqueId(), status); + return Either.right(status); + } + + + MapCapabiltyProperty allCalculatedCapProp = calcCapProp==null ||!calcCapProp.containsKey(componentInstanceData.getUniqueId())?new MapCapabiltyProperty() :calcCapProp.get(componentInstanceData.getUniqueId()); + + + additionalCap.forEach(new BiConsumer>() { + @Override + public void accept(String s, List caps) { + + if (caps != null && !caps.isEmpty()) { + + MapPropertiesDataDefinition dataToCreate = new MapPropertiesDataDefinition(); + + for (CapabilityDefinition cap : caps) { + List capPrps = cap.getProperties(); + if (capPrps != null) { + + for (ComponentInstanceProperty cip : capPrps) { + dataToCreate.put(cip.getName(), new PropertyDataDefinition(cip)); + } + + + StringBuffer sb = new StringBuffer(componentInstance.getUniqueId()); + sb.append(ModelConverter.CAP_PROP_DELIM); + + sb.append(cap.getOwnerId()); + + sb.append(ModelConverter.CAP_PROP_DELIM).append(s).append(ModelConverter.CAP_PROP_DELIM).append(cap.getName()); + allCalculatedCapProp.put(sb.toString(), dataToCreate); + } + } + + } + + } + }); + + status = addToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_CAP_PROPERTIES, VertexTypeEnum.CALCULATED_CAP_PROPERTIES, allCalculatedCapProp, + componentInstance.getUniqueId()); + } + + /********Requirements property****************************/ + if(additionalReq != null && !additionalReq.isEmpty()){ + + MapListRequirementDataDefinition allCalculatedReq = calcReg==null ||!calcReg.containsKey(componentInstanceData.getUniqueId())?new MapListRequirementDataDefinition() :calcReg.get(componentInstanceData.getUniqueId()); + status = deleteToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_REQUIREMENTS, VertexTypeEnum.CALCULATED_REQUIREMENTS, componentInstanceData.getUniqueId()); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to remove calculated Requirements for instance {} in container {}. error {] ", componentInstanceData.getUniqueId(), updatedContainer.getUniqueId(), status); + return Either.right(status); + } + + Map serverReq = additionalReq.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, en -> new ListRequirementDataDefinition(en.getValue().stream().map(iCap -> new RequirementDataDefinition(iCap)).collect(Collectors.toList())))); + + serverReq.entrySet().forEach(entryPerType -> { + entryPerType.getValue().getListToscaDataDefinition().forEach(cap -> { + cap.addToPath(componentInstance.getUniqueId()); + allCalculatedReq.add(entryPerType.getKey(), cap); + }); + }); + + status = addToscaDataDeepElementsBlockToToscaElement(updatedContainer.getUniqueId(), EdgeLabelEnum.CALCULATED_REQUIREMENTS, VertexTypeEnum.CALCULATED_REQUIREMENTS, allCalculatedReq, + componentInstance.getUniqueId()); + + } + + + Either updatedComponentInstanceRes = topologyTemplateOperation.getToscaElement(updatedContainer.getUniqueId()); + if (updatedComponentInstanceRes.isRight()) { + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to fetch updated topology template {} with new component instance {}. ", updatedContainer.getName(), componentInstance.getName()); + result = Either.right(updatedComponentInstanceRes.right().value()); + } + result = Either.left(new ImmutablePair<>((TopologyTemplate)updatedComponentInstanceRes.left().value(), componentInstanceData.getUniqueId())); + return result; + } + + private Either buildValidateInstanceName(TopologyTemplate container, ToscaElement originToscaElement, ComponentInstance componentInstance, String instanceNumberSuffix) { Either result = null; String instanceName = componentInstance.getName(); - if (StringUtils.isEmpty(instanceName) || instanceName.equalsIgnoreCase(originToscaElement.getName())) { + if (StringUtils.isEmpty(instanceName) || instanceName.equalsIgnoreCase(originToscaElement.getName()) || componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy) { instanceName = buildComponentInstanceName(instanceNumberSuffix, instanceName); } else if (!isUniqueInstanceName(container, componentInstance.getName())) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to create component instance with name {} on component container {}. The instance with the same name already exists. ", componentInstance.getName(), container.getName()); @@ -265,7 +402,7 @@ public class NodeTemplateOperation extends BaseOperation { return result; } - public Either updateComponentInstanceMetadataOfTopologyTemplate(TopologyTemplate container) { + public Either updateComponentInstanceMetadataOfTopologyTemplate(TopologyTemplate container, ComponentParametersView filter) { Either result = null; Either updateContainerComponentRes = null; @@ -291,7 +428,7 @@ public class NodeTemplateOperation extends BaseOperation { } } if (result == null) { - updateContainerComponentRes = topologyTemplateOperation.getToscaElement(containerComponentId); + updateContainerComponentRes = topologyTemplateOperation.getToscaElement(containerComponentId, filter); if (updateContainerComponentRes.isRight()) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to fetch updated topology template {}. ", container.getName()); result = Either.right(updateContainerComponentRes.right().value()); @@ -368,8 +505,8 @@ public class NodeTemplateOperation extends BaseOperation { Map calculatedCapabilty = capResult.left().value().getRight(); Either>, StorageOperationStatus> capFullResult = fetchContainerCalculatedCapability(containerV, EdgeLabelEnum.FULLFILLED_CAPABILITIES); - if (capResult.isRight()) { - return capResult.right().value(); + if (capFullResult.isRight()) { + return capFullResult.right().value(); } Map fullFilledCapabilty = capFullResult.left().value().getRight(); @@ -393,12 +530,12 @@ public class NodeTemplateOperation extends BaseOperation { if (relationToDelete.getFromId().equals(ciToRemove) || relationToDelete.getToId().equals(ciToRemove)) { iterator.remove(); if (relationToDelete.getFromId().equals(ciToRemove)) { - updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fullfilledRequirement, ciToRemove, relationToDelete); - updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapabilty, fullFilledCapabilty, relationToDelete.getToId(), relationToDelete); + updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fullfilledRequirement, ciToRemove, relationToDelete, null); + updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapabilty, fullFilledCapabilty, relationToDelete.getToId(), relationToDelete, null); } if (relationToDelete.getToId().equals(ciToRemove)) { - updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fullfilledRequirement, relationToDelete.getFromId(), relationToDelete); - updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapabilty, fullFilledCapabilty, ciToRemove, relationToDelete); + updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fullfilledRequirement, relationToDelete.getFromId(), relationToDelete, null); + updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapabilty, fullFilledCapabilty, ciToRemove, relationToDelete, null); } } } @@ -594,14 +731,14 @@ public class NodeTemplateOperation extends BaseOperation { if (status != StorageOperationStatus.OK) { return status; } - + return addCalculatedCapReqFromNodeType(originNodeType, componentInstance, updatedContainerVertex); } public MapArtifactDataDefinition prepareInstDeploymentArtifactPerInstance(Map deploymentArtifacts, String componentInstanceId, User user, String envType) { if (deploymentArtifacts != null && envType.equals(HEAT_VF_ENV_NAME)) { Map instDeploymentArtifacts = new HashMap<>(); - + deploymentArtifacts.entrySet().forEach(e -> { ArtifactDataDefinition artifact = e.getValue(); String type = artifact.getArtifactType(); @@ -610,10 +747,10 @@ public class NodeTemplateOperation extends BaseOperation { instDeploymentArtifacts.put(artifactEnv.getArtifactLabel(), artifactEnv); } }); - + deploymentArtifacts.putAll(instDeploymentArtifacts); MapArtifactDataDefinition instArtifacts = new MapArtifactDataDefinition(deploymentArtifacts); - + return instArtifacts; } return null; @@ -744,13 +881,21 @@ public class NodeTemplateOperation extends BaseOperation { sb.append(ModelConverter.CAP_PROP_DELIM).append(instanceId).append(ModelConverter.CAP_PROP_DELIM).append(key); return sb.toString(); } - + + /** + * Prepares a map of capabilities lists + * Produces a deep copy of the received map of capabilities + * Sets values to the specific fields according to received component instance + * @param capabilities + * @param componentInstance + * @return + */ public MapListCapabiltyDataDefinition prepareCalculatedCapabiltyForNodeType(Map capabilities, ComponentInstanceDataDefinition componentInstance) { if (capabilities != null) { MapListCapabiltyDataDefinition allCalculatedCap = new MapListCapabiltyDataDefinition(); capabilities.entrySet().forEach(e -> { - List listCapabilities = e.getValue().getListToscaDataDefinition(); + List listCapabilities = e.getValue().getListToscaDataDefinition().stream().map(c -> new CapabilityDataDefinition(c)).collect(Collectors.toList()); listCapabilities.forEach(cap -> { cap.setSource(componentInstance.getComponentUid()); cap.addToPath(componentInstance.getUniqueId()); @@ -765,13 +910,21 @@ public class NodeTemplateOperation extends BaseOperation { return null; } + /** + * Prepares a map of requirements lists + * Produces a deep copy of the received map of requirements + * Sets values to the specific fields according to received component instance + * @param requirements + * @param componentInstance + * @return + */ public MapListRequirementDataDefinition prepareCalculatedRequirementForNodeType(Map requirements, ComponentInstanceDataDefinition componentInstance) { if (requirements != null) { MapListRequirementDataDefinition allCalculatedReq = new MapListRequirementDataDefinition(); requirements.entrySet().forEach(e -> { - List listCapabilities = e.getValue().getListToscaDataDefinition(); - listCapabilities.forEach(req -> { + List listRequirements = e.getValue().getListToscaDataDefinition().stream().map(r -> new RequirementDataDefinition(r)).collect(Collectors.toList()); + listRequirements.forEach(req -> { req.setSource(componentInstance.getComponentUid()); req.addToPath(componentInstance.getUniqueId()); req.setOwnerId(componentInstance.getUniqueId()); @@ -809,8 +962,6 @@ public class NodeTemplateOperation extends BaseOperation { return result; } - - private ComponentInstanceDataDefinition buildComponentInstanceDataDefinition(ComponentInstance resourceInstance, String containerComponentId, String instanceNewName, boolean generateUid, ToscaElement originToscaElement) { String ciOriginComponentUid = resourceInstance.getComponentUid(); @@ -845,7 +996,7 @@ public class NodeTemplateOperation extends BaseOperation { dataDefinition.setComponentVersion((String) originToscaElement.getMetadataValue(JsonPresentationFields.VERSION)); if (StringUtils.isEmpty(dataDefinition.getComponentName()) && originToscaElement != null) dataDefinition.setComponentName((String) originToscaElement.getMetadataValue(JsonPresentationFields.NAME)); - if (originToscaElement != null) + if (originToscaElement != null && dataDefinition.getToscaComponentName() == null) dataDefinition.setToscaComponentName((String) originToscaElement.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); if (dataDefinition.getOriginType() == null && originToscaElement != null) { ResourceTypeEnum resourceType = originToscaElement.getResourceType(); @@ -869,11 +1020,20 @@ public class NodeTemplateOperation extends BaseOperation { case PNF: originType = OriginTypeEnum.PNF; break; + case ServiceProxy: + originType = OriginTypeEnum.ServiceProxy; + break; + case Configuration: + originType = OriginTypeEnum.Configuration; + break; default: break; } dataDefinition.setOriginType(originType); } + if(dataDefinition.getOriginType() == OriginTypeEnum.ServiceProxy) + dataDefinition.setIsProxy(true); + return dataDefinition; } @@ -888,10 +1048,6 @@ public class NodeTemplateOperation extends BaseOperation { return isUniqueName; } - - - - private String buildComponentInstanceName(String instanceSuffixNumber, String instanceName) { return instanceName + " " + (instanceSuffixNumber == null ? 0 : instanceSuffixNumber); } @@ -907,7 +1063,7 @@ public class NodeTemplateOperation extends BaseOperation { } @SuppressWarnings({ "unchecked" }) - public Either, StorageOperationStatus> associateResourceInstances(String componentId, List relations) { + public Either, StorageOperationStatus> associateResourceInstances(String componentId, List relations) { Either containerVEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); if (containerVEither.isRight()) { @@ -916,7 +1072,7 @@ public class NodeTemplateOperation extends BaseOperation { return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(error)); } GraphVertex containerV = containerVEither.left().value(); - List relationshipsResult = new ArrayList(); + List relationshipsResult = new ArrayList<>(); Either>, StorageOperationStatus> capResult = fetchContainerCalculatedCapability(containerV, EdgeLabelEnum.CALCULATED_CAPABILITIES); if (capResult.isRight()) { return Either.right(capResult.right().value()); @@ -952,17 +1108,17 @@ public class NodeTemplateOperation extends BaseOperation { String fromNode = relation.getFromNode(); String toNode = relation.getToNode(); - List relationships = relation.getRelationships(); + List relationships = relation.getRelationships(); if (relationships == null || relationships.isEmpty()) { BeEcompErrorManager.getInstance().logBeFailedAddingResourceInstanceError("AssociateResourceInstances - missing relationship", fromNode, componentId); CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No requirement definition sent in order to set the relation between {} to {}", fromNode, toNode); return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.ILLEGAL_ARGUMENT)); } - for (RequirementAndRelationshipPair immutablePair : relationships) { - String requirement = immutablePair.getRequirement(); + for (CapabilityRequirementRelationship immutablePair : relationships) { + String requirement = immutablePair.getRelation().getRequirement(); - Either associateRes = connectInstancesInContainer(fromNode, toNode, immutablePair, calculatedCapabilty, calculatedRequirement, fullFilledCapabilty, fullfilledRequirement, + Either, StorageOperationStatus> associateRes = connectInstancesInContainer(fromNode, toNode, immutablePair.getRelation(), calculatedCapabilty, calculatedRequirement, fullFilledCapabilty, fullfilledRequirement, compositionDataDefinition, containerV.getUniqueId()); if (associateRes.isRight()) { @@ -972,16 +1128,22 @@ public class NodeTemplateOperation extends BaseOperation { return Either.right(status); } - RelationshipInstDataDefinition relationshipInstData = associateRes.left().value(); + RelationshipInstDataDefinition relationshipInstData = (RelationshipInstDataDefinition) associateRes.left().value().get(JsonPresentationFields.RELATIONSHIP); RelationshipImpl relationshipImplResult = new RelationshipImpl(); relationshipImplResult.setType(relationshipInstData.getType()); - RequirementAndRelationshipPair requirementAndRelationshipPair = new RequirementAndRelationshipPair(requirement, relationshipImplResult); - requirementAndRelationshipPair.setCapability(immutablePair.getCapability()); + RelationshipInfo requirementAndRelationshipPair = new RelationshipInfo(requirement, relationshipImplResult); + requirementAndRelationshipPair.setCapability(immutablePair.getRelation().getCapability()); + requirementAndRelationshipPair.setRequirement(immutablePair.getRelation().getRequirement()); requirementAndRelationshipPair.setCapabilityOwnerId(relationshipInstData.getCapabilityOwnerId()); requirementAndRelationshipPair.setRequirementOwnerId(relationshipInstData.getRequirementOwnerId()); - requirementAndRelationshipPair.setCapabilityUid(immutablePair.getCapabilityUid()); - requirementAndRelationshipPair.setRequirementUid(immutablePair.getRequirementUid()); - relationshipsResult.add(requirementAndRelationshipPair); + requirementAndRelationshipPair.setCapabilityUid(immutablePair.getRelation().getCapabilityUid()); + requirementAndRelationshipPair.setRequirementUid(immutablePair.getRelation().getRequirementUid()); + requirementAndRelationshipPair.setId(relationshipInstData.getUniqueId()); + CapabilityRequirementRelationship capReqRel = new CapabilityRequirementRelationship(); + capReqRel.setRelation(requirementAndRelationshipPair); + capReqRel.setCapability((CapabilityDataDefinition) associateRes.left().value().get(JsonPresentationFields.CAPAPILITY)); + capReqRel.setRequirement((RequirementDataDefinition) associateRes.left().value().get(JsonPresentationFields.REQUIREMENT)); + relationshipsResult.add(capReqRel); CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "update customization UUID for from CI {} and to CI {}", relation.getFromNode(), relation.getToNode()); status = updateCustomizationUUID(relation.getFromNode(), compositionDataDefinition); if (status != StorageOperationStatus.OK) { @@ -1088,7 +1250,7 @@ public class NodeTemplateOperation extends BaseOperation { } Map relations = compositionDataDefinition.getRelations(); - List relationPairList = requirementDef.getRelationships(); + List relationPairList = requirementDef.getRelationships(); Either>, StorageOperationStatus> capResult = fetchContainerCalculatedCapability(containerV, EdgeLabelEnum.CALCULATED_CAPABILITIES); if (capResult.isRight()) { return Either.right(capResult.right().value()); @@ -1114,24 +1276,24 @@ public class NodeTemplateOperation extends BaseOperation { } Map fulfilledRequirement = reqFullResult.left().value().getRight(); - for (RequirementAndRelationshipPair relationPair : relationPairList) { + for (CapabilityRequirementRelationship relationPair : relationPairList) { Iterator> iterator = relations.entrySet().iterator(); boolean isDeleted = false; while (iterator.hasNext()) { Entry entryInJson = iterator.next(); RelationshipInstDataDefinition relationInJson = entryInJson.getValue(); - if (relationInJson.getFromId().equals(fromResInstanceUid) && relationInJson.getToId().equals(toResInstanceUid)) { - if (relationPair.equalsTo(relationInJson)) { + if (relationInJson.getFromId().equals(fromResInstanceUid) && relationInJson.getToId().equals(toResInstanceUid) && relationInJson.getUniqueId().equals(relationPair.getRelation().getId())) { + if (relationPair.getRelation().equalsTo(relationInJson)) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Remove relation from {} to {} capability {} capOwnerId {} reqOwnerId {} ", toResInstanceUid, componentId, relationInJson.getType(), relationInJson.getCapabilityOwnerId(), relationInJson.getRequirementOwnerId()); iterator.remove(); // update calculated cap/req - StorageOperationStatus status = updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapability, fulfilledCapability, toResInstanceUid, relationInJson); + StorageOperationStatus status = updateCalculatedCapabiltyAfterDeleteRelation(calculatedCapability, fulfilledCapability, toResInstanceUid, relationInJson, relationPair); if (status != StorageOperationStatus.OK) { return Either.right(status); } - status = updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fulfilledRequirement, fromResInstanceUid, relationInJson); + status = updateCalculatedRequirementsAfterDeleteRelation(calculatedRequirement, fulfilledRequirement, fromResInstanceUid, relationInJson, relationPair); if (status != StorageOperationStatus.OK) { return Either.right(status); } @@ -1139,9 +1301,9 @@ public class NodeTemplateOperation extends BaseOperation { } } } - if (isDeleted == false) { + if (!isDeleted) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No relation to delete from {} to {} capabilty {} capOwnerId {} reqOwnerId {} ", toResInstanceUid, componentId, relationPair.getCapability(), - relationPair.getCapabilityOwnerId(), relationPair.getRequirementOwnerId()); + relationPair.getRelation().getCapabilityOwnerId(), relationPair.getRelation().getRequirementOwnerId()); return Either.right(StorageOperationStatus.NOT_FOUND); } } @@ -1163,15 +1325,108 @@ public class NodeTemplateOperation extends BaseOperation { return Either.left(requirementDef); } + + /** + * Retrieves fulfilled requirement according to relation and received predicate + * @param componentId + * @param instanceId + * @param foundRelation + * @param predicate + * @return + */ + public Either getFulfilledRequirementByRelation(String componentId, String instanceId, RequirementCapabilityRelDef foundRelation, BiPredicate predicate) { + + Either result = null; + Either>, StorageOperationStatus> reqFullResult = null; + MapListRequirementDataDefinition reqMapOfLists = null; + Optional foundRequirement; + RelationshipInfo relationshipInfo = foundRelation.getSingleRelationship().getRelation(); + Either containerVEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); + if (containerVEither.isRight()) { + TitanOperationStatus error = containerVEither.right().value(); + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to fetch container vertex {} error {}", componentId, error); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(error)); + } + if(result == null){ + GraphVertex containerV = containerVEither.left().value(); + reqFullResult = fetchContainerCalculatedRequirement(containerV, EdgeLabelEnum.FULLFILLED_REQUIREMENTS); + if (reqFullResult.isRight()) { + result = Either.right(reqFullResult.right().value()); + } + } + if(result == null){ + Map fulfilledRequirement = reqFullResult.left().value().getRight(); + reqMapOfLists = fulfilledRequirement.get(instanceId); + if(reqMapOfLists == null){ + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + if(result == null && reqMapOfLists != null){ + for(ListRequirementDataDefinition requirements : reqMapOfLists.getMapToscaDataDefinition().values()){ + foundRequirement = requirements.getListToscaDataDefinition().stream().filter(req -> predicate.test(relationshipInfo, req)).findFirst(); + if(foundRequirement.isPresent()){ + result = Either.left(foundRequirement.get()); + } + } + } + return result; + } + + /** + * Retrieves fulfilled capability according to relation and received predicate + * @param componentId + * @param instanceId + * @param foundRelation + * @param predicate + * @return + */ + public Either getFulfilledCapabilityByRelation(String componentId, String instanceId, RequirementCapabilityRelDef foundRelation, BiPredicate predicate) { + + Either result = null; + Either>, StorageOperationStatus> capFullResult = null; + MapListCapabiltyDataDefinition capMapOfLists = null; + Optional foundRequirement; + + RelationshipInfo relationshipInfo = foundRelation.getSingleRelationship().getRelation(); + Either containerVEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); + if (containerVEither.isRight()) { + TitanOperationStatus error = containerVEither.right().value(); + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to fetch container vertex {} error {}", componentId, error); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(error)); + } + if(result == null){ + GraphVertex containerV = containerVEither.left().value(); + capFullResult = fetchContainerCalculatedCapability(containerV, EdgeLabelEnum.FULLFILLED_CAPABILITIES); + if (capFullResult.isRight()) { + result = Either.right(capFullResult.right().value()); + } + } + if(result == null){ + Map fulfilledCapability = capFullResult.left().value().getRight(); + capMapOfLists = fulfilledCapability.get(instanceId); + if(capMapOfLists == null){ + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + if(result == null && capMapOfLists != null){ + for(ListCapabilityDataDefinition capabilities : capMapOfLists.getMapToscaDataDefinition().values()){ + foundRequirement = capabilities.getListToscaDataDefinition().stream().filter(cap -> predicate.test(relationshipInfo, cap)).findFirst(); + if(foundRequirement.isPresent()){ + result = Either.left(foundRequirement.get()); + } + } + } + return result; + } private StorageOperationStatus updateCalculatedRequirementsAfterDeleteRelation(Map calculatedRequirement, Map fullFilledRequirement, String fromResInstanceUid, - RelationshipInstDataDefinition relation) { + RelationshipInstDataDefinition relation, CapabilityRequirementRelationship relationship) { StorageOperationStatus status; String hereIsTheKey = null; MapListRequirementDataDefinition reqByInstance = calculatedRequirement.get(fromResInstanceUid); if (reqByInstance == null || reqByInstance.findKeyByItemUidMatch(relation.getRequirementId()) == null) { // move from fulfilled - status = moveFromFullFilledRequirement(calculatedRequirement, fullFilledRequirement, fromResInstanceUid, relation, hereIsTheKey); + status = moveFromFullFilledRequirement(calculatedRequirement, fullFilledRequirement, fromResInstanceUid, relation, hereIsTheKey, relationship); } else { hereIsTheKey = reqByInstance.findKeyByItemUidMatch(relation.getRequirementId()); ListRequirementDataDefinition reqByType = reqByInstance.findByKey(hereIsTheKey); @@ -1187,29 +1442,31 @@ public class NodeTemplateOperation extends BaseOperation { ++leftIntValue; requirement.setLeftOccurrences(String.valueOf(leftIntValue)); } + if(relationship != null){ + relationship.setRequirement(requirement); + } status = StorageOperationStatus.OK; } else { // move from fulfilled - status = moveFromFullFilledRequirement(calculatedRequirement, fullFilledRequirement, fromResInstanceUid, relation, hereIsTheKey); + status = moveFromFullFilledRequirement(calculatedRequirement, fullFilledRequirement, fromResInstanceUid, relation, hereIsTheKey, relationship); } } return status; } - private StorageOperationStatus updateCalculatedCapabiltyAfterDeleteRelation(Map calculatedCapability, Map fullFilledCapability, String toResInstanceUid, - RelationshipInstDataDefinition relation) { + RelationshipInstDataDefinition relation, CapabilityRequirementRelationship relationship) { StorageOperationStatus status; String hereIsTheKey = null; MapListCapabiltyDataDefinition capByInstance = calculatedCapability.get(toResInstanceUid); if (capByInstance == null || capByInstance.findKeyByItemUidMatch(relation.getCapabilityId()) == null) { // move from fulfilled - status = moveFromFullFilledCapabilty(calculatedCapability, fullFilledCapability, toResInstanceUid, relation, hereIsTheKey); + status = moveFromFullFilledCapabilty(calculatedCapability, fullFilledCapability, toResInstanceUid, relation, hereIsTheKey, relationship); } else { hereIsTheKey = capByInstance.findKeyByItemUidMatch(relation.getCapabilityId()); ListCapabilityDataDefinition capByType = capByInstance.findByKey(hereIsTheKey); - Optional capabilityOptional = capByType.getListToscaDataDefinition().stream() - .filter(cap -> cap.getOwnerId().equals(relation.getCapabilityOwnerId()) && cap.getUniqueId().equals(relation.getCapabilityId())).findFirst(); + Optional capabilityOptional = capByType.getListToscaDataDefinition().stream().filter(cap -> cap.getOwnerId().equals(relation.getCapabilityOwnerId()) && cap.getUniqueId().equals(relation.getCapabilityId())) + .findFirst(); if (capabilityOptional.isPresent()) { @@ -1220,17 +1477,20 @@ public class NodeTemplateOperation extends BaseOperation { ++leftIntValue; capability.setLeftOccurrences(String.valueOf(leftIntValue)); } + if(relationship != null){ + relationship.setCapability(capability); + } status = StorageOperationStatus.OK; } else { // move from fulfilled - status = moveFromFullFilledCapabilty(calculatedCapability, fullFilledCapability, toResInstanceUid, relation, hereIsTheKey); + status = moveFromFullFilledCapabilty(calculatedCapability, fullFilledCapability, toResInstanceUid, relation, hereIsTheKey, relationship); } } return status; } private StorageOperationStatus moveFromFullFilledCapabilty(Map calculatedCapability, Map fullFilledCapability, String toResInstanceUid, - RelationshipInstDataDefinition relation, String hereIsTheKey) { + RelationshipInstDataDefinition relation, String hereIsTheKey, CapabilityRequirementRelationship relationship) { MapListCapabiltyDataDefinition capByInstance = fullFilledCapability.get(toResInstanceUid); if (capByInstance == null) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No capability in fulfilled list for instance {} ", toResInstanceUid); @@ -1266,6 +1526,7 @@ public class NodeTemplateOperation extends BaseOperation { mapListCapaDataDef.put(hereIsTheKey, findByKey); } findByKey.add(cap); + relationship.setCapability(cap); break; } } @@ -1277,13 +1538,13 @@ public class NodeTemplateOperation extends BaseOperation { } private StorageOperationStatus moveFromFullFilledRequirement(Map calculatedRequirement, Map fullFilledRequirement, String fromResInstanceUid, - RelationshipInstDataDefinition relation, String hereIsTheKey) { + RelationshipInstDataDefinition relation, String hereIsTheKey, CapabilityRequirementRelationship relationship) { MapListRequirementDataDefinition reqByInstance = fullFilledRequirement.get(fromResInstanceUid); if (reqByInstance == null) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No requirement in fullfilled list for instance {} ", fromResInstanceUid); return StorageOperationStatus.GENERAL_ERROR; } - if(null == hereIsTheKey) + if (null == hereIsTheKey) hereIsTheKey = reqByInstance.findKeyByItemUidMatch(relation.getRequirementId()); if (null == hereIsTheKey) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No requirement with id {} in fulfilled list for instance {} ", relation.getRequirementId(), fromResInstanceUid); @@ -1313,6 +1574,7 @@ public class NodeTemplateOperation extends BaseOperation { mapListReqDataDef.put(hereIsTheKey, findByKey); } findByKey.add(req); + relationship.setRequirement(req); break; } } @@ -1337,7 +1599,7 @@ public class NodeTemplateOperation extends BaseOperation { return StorageOperationStatus.OK; } - public Either connectInstancesInContainer(String fromResInstanceUid, String toResInstanceUid, RequirementAndRelationshipPair relationPair, + public Either, StorageOperationStatus> connectInstancesInContainer(String fromResInstanceUid, String toResInstanceUid, RelationshipInfo relationPair, Map calculatedCapabilty, Map calculatedRequirement, Map fullfilledCapabilty, Map fullfilledRequirement, CompositionDataDefinition compositionDataDefinition, String containerId) { String requirement = relationPair.getRequirement(); @@ -1356,19 +1618,19 @@ public class NodeTemplateOperation extends BaseOperation { return Either.right(StorageOperationStatus.NOT_FOUND); } - Either reqVsCap = connectRequirementVsCapability(fromResourceInstData, toResourceInstData, relationPair, calculatedCapabilty, calculatedRequirement, fullfilledCapabilty, + Either, StorageOperationStatus> reqVsCap = connectRequirementVsCapability(fromResourceInstData, toResourceInstData, relationPair, calculatedCapabilty, calculatedRequirement, fullfilledCapabilty, fullfilledRequirement, containerId); if (reqVsCap.isRight()) { StorageOperationStatus status = reqVsCap.right().value(); CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to connect requirement {} between resource instance {} to resource instance {}. status is {}", requirement, fromResInstanceUid, toResInstanceUid, status); return Either.right(status); } - RelationshipInstDataDefinition relation = reqVsCap.left().value(); + Map relationship = reqVsCap.left().value(); // add to json new relations - compositionDataDefinition.addRelation(relation.getUniqueId(), relation); + compositionDataDefinition.addRelation(((RelationshipInstDataDefinition)relationship.get(JsonPresentationFields.RELATIONSHIP)).getUniqueId(), (RelationshipInstDataDefinition)relationship.get(JsonPresentationFields.RELATIONSHIP)); - return Either.left(relation); + return Either.left(relationship); } private Either>, StorageOperationStatus> fetchContainerCalculatedCapability(GraphVertex containerV, EdgeLabelEnum capLabel) { @@ -1394,7 +1656,8 @@ public class NodeTemplateOperation extends BaseOperation { return Either.left(calculatedRequirement); } - private Either connectRequirementVsCapability(ComponentInstanceDataDefinition fromResInstance, ComponentInstanceDataDefinition toResInstance, RequirementAndRelationshipPair relationPair, + @SuppressWarnings("unchecked") + private Either, StorageOperationStatus> connectRequirementVsCapability(ComponentInstanceDataDefinition fromResInstance, ComponentInstanceDataDefinition toResInstance, RelationshipInfo relationPair, Map calculatedCapabilty, Map calculatedRequirement, Map fullfilledCapabilty, Map fullfilledRequirement, String containerId) { String type = relationPair.getRelationship().getType(); @@ -1402,6 +1665,7 @@ public class NodeTemplateOperation extends BaseOperation { String toInstId = toResInstance.getUniqueId(); MapListCapabiltyDataDefinition mapListCapabiltyDataDefinition = calculatedCapabilty.get(toInstId); + Map capReqRelationship = new EnumMap<>(JsonPresentationFields.class); if (mapListCapabiltyDataDefinition == null) { CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to fetch calculated capabilities for instance {} in container {}.", toInstId, containerId); @@ -1418,6 +1682,7 @@ public class NodeTemplateOperation extends BaseOperation { CapabilityDataDefinition cap = iteratorCap.next(); if (cap.getUniqueId().equals(relationPair.getCapabilityUid()) && cap.getOwnerId().equals(relationPair.getCapabilityOwnerId())) { capabilityForRelation = cap; + capReqRelationship.put(JsonPresentationFields.CAPAPILITY, (T)capabilityForRelation); String leftOccurrences = cap.getLeftOccurrences(); if (leftOccurrences != null && !leftOccurrences.equals(CapabilityDataDefinition.MAX_OCCURRENCES)) { Integer leftIntValue = Integer.parseInt(leftOccurrences); @@ -1473,7 +1738,7 @@ public class NodeTemplateOperation extends BaseOperation { RequirementDataDefinition req = iteratorReq.next(); if (req.getUniqueId().equals(relationPair.getRequirementUid()) && req.getOwnerId().equals(relationPair.getRequirementOwnerId())) { requirementForRelation = req; - + capReqRelationship.put(JsonPresentationFields.REQUIREMENT, (T)requirementForRelation); String leftOccurrences = req.getLeftOccurrences(); if (leftOccurrences != null && !leftOccurrences.equals(RequirementDataDefinition.MAX_OCCURRENCES)) { Integer leftIntValue = Integer.parseInt(leftOccurrences); @@ -1506,17 +1771,19 @@ public class NodeTemplateOperation extends BaseOperation { } } if (!capabilityForRelation.getType().equals(requirementForRelation.getCapability())) { - CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No math for capability from type {} and requirement {} from {} to {} in container {}.", capabilityForRelation.getType(), requirementForRelation.getCapability(), fromInstId, toInstId, - containerId); + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "No math for capability from type {} and requirement {} from {} to {} in container {}.", capabilityForRelation.getType(), requirementForRelation.getCapability(), fromInstId, + toInstId, containerId); return Either.right(StorageOperationStatus.MATCH_NOT_FOUND); } RelationshipInstDataDefinition relationshipTypeData = buildRelationshipInstData(fromInstId, toInstId, relationPair); - relationshipTypeData.setType(requirementForRelation.getRelationship()); - return Either.left(relationshipTypeData); + if(requirementForRelation.getRelationship() != null) + relationshipTypeData.setType(requirementForRelation.getRelationship()); + capReqRelationship.put(JsonPresentationFields.RELATIONSHIP, (T)relationshipTypeData); + return Either.left(capReqRelationship); } - private RelationshipInstDataDefinition buildRelationshipInstData(String fromResInstanceUid, String toInstId, RequirementAndRelationshipPair relationPair) { + private RelationshipInstDataDefinition buildRelationshipInstData(String fromResInstanceUid, String toInstId, RelationshipInfo relationPair) { RelationshipInstDataDefinition relationshipInstData = new RelationshipInstDataDefinition(); relationshipInstData.setUniqueId(UniqueIdBuilder.buildRelationsipInstInstanceUid(fromResInstanceUid, toInstId)); @@ -1620,13 +1887,13 @@ public class NodeTemplateOperation extends BaseOperation { } public StorageOperationStatus addDeploymentArtifactsToInstance(String toscaElementId, String instanceId, Map instDeplArtifacts) { - return addArtifactsToInstance(toscaElementId, instanceId, instDeplArtifacts, EdgeLabelEnum.INST_DEPLOYMENT_ARTIFACTS, VertexTypeEnum.INST_DEPLOYMENT_ARTIFACTS); + return addArtifactsToInstance(toscaElementId, instanceId, instDeplArtifacts, EdgeLabelEnum.INST_DEPLOYMENT_ARTIFACTS, VertexTypeEnum.INST_DEPLOYMENT_ARTIFACTS); } - + public StorageOperationStatus addInformationalArtifactsToInstance(String toscaElementId, String instanceId, Map instDeplArtifacts) { - return addArtifactsToInstance(toscaElementId, instanceId, instDeplArtifacts, EdgeLabelEnum.INSTANCE_ARTIFACTS, VertexTypeEnum.INSTANCE_ARTIFACTS); + return addArtifactsToInstance(toscaElementId, instanceId, instDeplArtifacts, EdgeLabelEnum.INSTANCE_ARTIFACTS, VertexTypeEnum.INSTANCE_ARTIFACTS); } - + public StorageOperationStatus addArtifactsToInstance(String toscaElementId, String instanceId, Map instDeplArtifacts, EdgeLabelEnum edgeLabel, VertexTypeEnum vertexType) { Either metadataVertex = titanDao.getVertexById(toscaElementId, JsonParseFlagEnum.NoParse); if (metadataVertex.isRight()) { @@ -1637,7 +1904,7 @@ public class NodeTemplateOperation extends BaseOperation { return DaoStatusConverter.convertTitanStatusToStorageStatus(status); } MapArtifactDataDefinition instArtifacts = new MapArtifactDataDefinition(instDeplArtifacts); - return addToscaDataDeepElementsBlockToToscaElement(metadataVertex.left().value(),edgeLabel, vertexType, instArtifacts, instanceId); + return addToscaDataDeepElementsBlockToToscaElement(metadataVertex.left().value(), edgeLabel, vertexType, instArtifacts, instanceId); } @@ -1710,14 +1977,26 @@ public class NodeTemplateOperation extends BaseOperation { pathKeys.add(componentInstanceId); return updateToscaDataDeepElementOfToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_PROPERTIES, VertexTypeEnum.INST_PROPERTIES, property, pathKeys, JsonPresentationFields.NAME); } - - + + public StorageOperationStatus updateComponentInstanceCapabilityProperty(Component containerComponent, String componentInstanceId, String capabilityUniqueId, ComponentInstanceProperty property) { + List pathKeys = new ArrayList<>(); + pathKeys.add(componentInstanceId); + pathKeys.add(capabilityUniqueId); + return updateToscaDataDeepElementOfToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.CALCULATED_CAP_PROPERTIES, VertexTypeEnum.CALCULATED_CAP_PROPERTIES, property, pathKeys, JsonPresentationFields.NAME); + } + public StorageOperationStatus addComponentInstanceProperty(Component containerComponent, String componentInstanceId, ComponentInstanceProperty property) { List pathKeys = new ArrayList<>(); pathKeys.add(componentInstanceId); return addToscaDataDeepElementToToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_PROPERTIES, VertexTypeEnum.INST_PROPERTIES, property, pathKeys, JsonPresentationFields.NAME); } + public StorageOperationStatus updateComponentInstanceProperties(Component containerComponent, String componentInstanceId, List properties) { + List pathKeys = new ArrayList<>(); + pathKeys.add(componentInstanceId); + return updateToscaDataDeepElementsOfToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_PROPERTIES, VertexTypeEnum.INST_PROPERTIES, properties, pathKeys, JsonPresentationFields.NAME); + } + public StorageOperationStatus updateComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { List pathKeys = new ArrayList<>(); @@ -1725,11 +2004,16 @@ public class NodeTemplateOperation extends BaseOperation { return updateToscaDataDeepElementOfToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_INPUTS, VertexTypeEnum.INST_INPUTS, property, pathKeys, JsonPresentationFields.NAME); } + public StorageOperationStatus updateComponentInstanceInputs(Component containerComponent, String componentInstanceId, List properties) { + List pathKeys = new ArrayList<>(); + pathKeys.add(componentInstanceId); + return updateToscaDataDeepElementsOfToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_INPUTS, VertexTypeEnum.INST_INPUTS, properties, pathKeys, JsonPresentationFields.NAME); + } + public StorageOperationStatus addComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { List pathKeys = new ArrayList<>(); pathKeys.add(componentInstanceId); return addToscaDataDeepElementToToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_INPUTS, VertexTypeEnum.INST_INPUTS, property, pathKeys, JsonPresentationFields.NAME); } - } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java index e530144fe0..d46743cfa9 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java @@ -20,7 +20,15 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; import java.util.stream.Collectors; import org.apache.tinkerpop.gremlin.structure.Direction; @@ -54,16 +62,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.regex.Pattern; +import fj.data.Either; @org.springframework.stereotype.Component("node-type-operation") public class NodeTypeOperation extends ToscaElementOperation { @@ -472,20 +471,27 @@ public class NodeTypeOperation extends ToscaElementOperation { }); ToscaDataDefinition.mergeDataMaps(capabiltiesAll, capabilties); + capabiltiesAll.values().forEach(l -> { + l.getListToscaDataDefinition().forEach(c -> { + List capabilitySources = c.getCapabilitySources(); + if (capabilitySources == null) { + capabilitySources = new ArrayList<>(); + } + capabilitySources.add((String) nodeType.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); + c.setCapabilitySources(capabilitySources); + }); + }); } - capabiltiesAll.values().forEach(l -> { - l.getListToscaDataDefinition().forEach(c -> { - List capabilitySources = c.getCapabilitySources(); - if ( capabilitySources == null ){ - capabilitySources = new ArrayList<>(); - } - capabilitySources.add((String) nodeType.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); - c.setCapabilitySources(capabilitySources); - }); - }); - - + l.getListToscaDataDefinition().forEach(c -> { + List capabilitySources = c.getCapabilitySources(); + if (capabilitySources == null) { + capabilitySources = new ArrayList<>(); + } + capabilitySources.add((String) nodeType.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); + c.setCapabilitySources(capabilitySources); + }); + }); if (!capabiltiesAll.isEmpty()) { Either assosiateElementToData = assosiateElementToData(nodeTypeVertex, VertexTypeEnum.CAPABILTIES, EdgeLabelEnum.CAPABILITIES, capabiltiesAll); if (assosiateElementToData.isRight()) { @@ -514,7 +520,7 @@ public class NodeTypeOperation extends ToscaElementOperation { p.setUniqueId(uid); }); }); - + ToscaDataDefinition.mergeDataMaps(requirementsAll, requirements); } @@ -615,27 +621,25 @@ public class NodeTypeOperation extends ToscaElementOperation { } return Either.left(derivedResources); } - - Either, StorageOperationStatus> handleMultipleParent(String parentResource, List derivedResource, List fetchedDerivedResources){ - + + Either, StorageOperationStatus> handleMultipleParent(String parentResource, List derivedResource, List fetchedDerivedResources) { + Either, StorageOperationStatus> result = Either.left(derivedResource); - try{ - fetchedDerivedResources.sort((d1,d2)->{ - return new Double(Double.parseDouble((String)d1.getMetadataProperty(GraphPropertyEnum.VERSION))) - .compareTo(Double.parseDouble((String)d2.getMetadataProperty(GraphPropertyEnum.VERSION))); + try { + fetchedDerivedResources.sort((d1, d2) -> { + return new Double(Double.parseDouble((String) d1.getMetadataProperty(GraphPropertyEnum.VERSION))).compareTo(Double.parseDouble((String) d2.getMetadataProperty(GraphPropertyEnum.VERSION))); }); - + int actualHighestIndex = fetchedDerivedResources.size() - 1; derivedResource.add(fetchedDerivedResources.get(actualHighestIndex)); fetchedDerivedResources.remove(actualHighestIndex); - + StorageOperationStatus status = fixMultipleParent(fetchedDerivedResources); - if(status != StorageOperationStatus.OK){ + if (status != StorageOperationStatus.OK) { result = Either.right(status); } - } catch (Exception e){ - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Exception occured during handle multiple parent {}. Exception is {}", - parentResource, e.getMessage()); + } catch (Exception e) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Exception occured during handle multiple parent {}. Exception is {}", parentResource, e.getMessage()); result = Either.right(StorageOperationStatus.GENERAL_ERROR); } return result; @@ -643,13 +647,12 @@ public class NodeTypeOperation extends ToscaElementOperation { private StorageOperationStatus fixMultipleParent(List fetchedDerivedResources) { StorageOperationStatus result = StorageOperationStatus.OK; - for(GraphVertex fetchedDerivedResource : fetchedDerivedResources){ + for (GraphVertex fetchedDerivedResource : fetchedDerivedResources) { fetchedDerivedResource.addMetadataProperty(GraphPropertyEnum.IS_HIGHEST_VERSION, false); Either updateVertexRes = titanDao.updateVertex(fetchedDerivedResource); if (updateVertexRes.isRight()) { TitanOperationStatus titatStatus = updateVertexRes.right().value(); - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to set highest version of node type {} to false. Status is {}", - fetchedDerivedResource.getMetadataProperty(GraphPropertyEnum.TOSCA_RESOURCE_NAME), titatStatus); + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to set highest version of node type {} to false. Status is {}", fetchedDerivedResource.getMetadataProperty(GraphPropertyEnum.TOSCA_RESOURCE_NAME), titatStatus); result = DaoStatusConverter.convertTitanStatusToStorageStatus(titatStatus); break; } @@ -805,9 +808,9 @@ public class NodeTypeOperation extends ToscaElementOperation { return StorageOperationStatus.OK; } - + private StorageOperationStatus associateDerivedDataByType(EdgeLabelEnum edgeLabel, GraphVertex nodeTypeV, NodeType nodeToUpdate, List newDerived) { - + switch (edgeLabel) { case CAPABILITIES: return associateCapabilitiesToResource(nodeTypeV, nodeToUpdate, newDerived); @@ -873,12 +876,24 @@ public class NodeTypeOperation extends ToscaElementOperation { return dataFromDerived.right().value(); } Map dataFromDerivedAll = dataFromDerived.left().value(); - + Either, String> merged = ToscaDataDefinition.mergeDataMaps(dataFromDerivedAll, mapFromGraph); - if(merged.isRight()){ + if (merged.isRight()) { log.debug("property {} cannot be overriden", merged.right().value()); return StorageOperationStatus.INVALID_PROPERTY; } + if (mergeValues && valuesFrmPrev != null) { + valuesFrmPrev.entrySet().forEach(e -> { + T newData = merged.left().value().get(e.getKey()); + if (newData != null) { + if (isSimpleHierarchy(label)) { + e.getValue().mergeFunction(newData, true); + }else{ + e.getValue().updateIfExist(newData, true); + } + } + }); + } dataV.setJson(dataFromDerivedAll); Either updateDataV = updateOrCopyOnUpdate(dataV, nodeTypeV, label); if (updateDataV.isRight()) { @@ -886,8 +901,8 @@ public class NodeTypeOperation extends ToscaElementOperation { } return StorageOperationStatus.OK; } - - private boolean isSimpleHierarchy(EdgeLabelEnum label) { + + private boolean isSimpleHierarchy(EdgeLabelEnum label) { switch (label) { case PROPERTIES: case ATTRIBUTES: @@ -901,7 +916,6 @@ public class NodeTypeOperation extends ToscaElementOperation { } } - @Override public void fillToscaElementVertexData(GraphVertex elementV, T toscaElementToUpdate, JsonParseFlagEnum flag) { fillMetadata(elementV, (NodeType) toscaElementToUpdate); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/TopologyTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/TopologyTemplateOperation.java index 989707bf0c..b1d4f151d8 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/TopologyTemplateOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/TopologyTemplateOperation.java @@ -26,9 +26,10 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Map.Entry; +import java.util.stream.Collectors; +import org.apache.commons.collections.MapUtils; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; @@ -51,7 +52,6 @@ import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; -import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.DistributionStatusEnum; @@ -61,6 +61,7 @@ import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum; import org.openecomp.sdc.be.model.jsontitan.enums.JsonConstantKeysEnum; +import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; @@ -1072,5 +1073,69 @@ public class TopologyTemplateOperation extends ToscaElementOperation { } return result; } + /** + * Returns list of ComponentInstanceProperty belonging to component instance capability specified by name and type + * @param componentId + * @param instanceId + * @param capabilityName + * @param capabilityType + * @return + */ + public Either, StorageOperationStatus> getComponentInstanceCapabilityProperties(String componentId, String instanceId, String capabilityName, String capabilityType) { + + Either, StorageOperationStatus> result = null; + Map mapPropertiesDataDefinition = null; + Either componentByLabelAndId = getComponentByLabelAndId(componentId, ToscaElementTypeEnum.TopologyTemplate, JsonParseFlagEnum.NoParse); + if (componentByLabelAndId.isRight()) { + result = Either.right(componentByLabelAndId.right().value()); + } + if(componentByLabelAndId.isLeft()){ + Either, TitanOperationStatus> getDataRes = getDataFromGraph(componentByLabelAndId.left().value(), EdgeLabelEnum.CALCULATED_CAP_PROPERTIES); + if (getDataRes.isRight()) { + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getDataRes.right().value())); + } else { + mapPropertiesDataDefinition = getDataRes.left().value(); + } + } + if(isNotEmptyMapOfProperties(instanceId, mapPropertiesDataDefinition)){ + result = Either.left(findComponentInstanceCapabilityProperties(instanceId, capabilityName, capabilityType, mapPropertiesDataDefinition.get(instanceId).getMapToscaDataDefinition())); + } + return result; + } + + private boolean isNotEmptyMapOfProperties(String instanceId, Map mapPropertiesDataDefinition) { + return MapUtils.isNotEmpty(mapPropertiesDataDefinition) && + mapPropertiesDataDefinition.get(instanceId) != null && + MapUtils.isNotEmpty(mapPropertiesDataDefinition.get(instanceId).getMapToscaDataDefinition()); + } + + private List findComponentInstanceCapabilityProperties(String instanceId, String capabilityName, String capabilityType, Map propertiesMap) { + List capPropsList = null; + for(Entry capProp : propertiesMap.entrySet()){ + if (isBelongingPropertyMap(instanceId, capabilityName, capabilityType, capProp)) { + Map capMap = capProp.getValue().getMapToscaDataDefinition(); + if (capMap != null && !capMap.isEmpty()) { + capPropsList = capMap.values().stream().map(o -> new ComponentInstanceProperty(o)).collect(Collectors.toList()); + break; + } + } + } + if(capPropsList == null){ + capPropsList = new ArrayList<>(); + } + return capPropsList; + } + + private boolean isBelongingPropertyMap(String instanceId, String capabilityName, String capabilityType, Entry capProp) { + if (capProp != null) { + String[] path = capProp.getKey().split(ModelConverter.CAP_PROP_DELIM ); + if (path.length < 4) { + log.debug("wrong key format for capabilty, key {}", capProp); + return false; + } + return path[path.length - 2].equals(capabilityType) && path[path.length - 1].equals(capabilityName) && path[0].equals(instanceId); + } + return false; + } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperation.java index 708ef783f1..ec55ddaf3b 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperation.java @@ -20,9 +20,16 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import fj.data.Either; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -59,9 +66,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.lang.reflect.Type; -import java.util.*; -import java.util.Map.Entry; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import fj.data.Either; public abstract class ToscaElementOperation extends BaseOperation { private static Logger log = LoggerFactory.getLogger(ToscaElementOperation.class.getName()); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java index 394231938a..15fb63f14c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java @@ -20,26 +20,68 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import java.util.*; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.function.BiPredicate; import java.util.stream.Collectors; + import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.elements.*; -import org.openecomp.sdc.be.datatypes.enums.*; -import org.openecomp.sdc.be.model.*; +import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapCapabiltyProperty; +import org.openecomp.sdc.be.datatypes.elements.MapListCapabiltyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; +import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.DistributionStatusEnum; +import org.openecomp.sdc.be.model.GroupDefinition; +import org.openecomp.sdc.be.model.GroupInstance; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.be.model.RelationshipInfo; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.utils.ModelConverter; @@ -47,7 +89,6 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; import org.openecomp.sdc.be.resources.data.ComponentMetadataData; -import org.openecomp.sdc.be.utils.CommonBeUtils; import org.openecomp.sdc.common.jsongraph.util.CommonUtility; import org.openecomp.sdc.common.jsongraph.util.CommonUtility.LogLevelEnum; import org.openecomp.sdc.common.util.ValidationUtils; @@ -55,489 +96,492 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.Collectors; +import fj.data.Either; @org.springframework.stereotype.Component("tosca-operation-facade") public class ToscaOperationFacade { - @Autowired - private NodeTypeOperation nodeTypeOperation; - @Autowired - private TopologyTemplateOperation topologyTemplateOperation; - @Autowired - private NodeTemplateOperation nodeTemplateOperation; - @Autowired - private GroupsOperation groupsOperation; - @Autowired - private TitanDao titanDao; - - private static Logger log = LoggerFactory.getLogger(ToscaOperationFacade.class.getName()); - - public Either getToscaElement(String componentId) { - - return getToscaElement(componentId, JsonParseFlagEnum.ParseAll); - - } - - public Either getToscaFullElement(String componentId) { - ComponentParametersView filters = new ComponentParametersView(); - filters.setIgnoreCapabiltyProperties(false); - - return getToscaElement(componentId, filters); - } - - public Either getToscaElement(String componentId, ComponentParametersView filters) { - - Either getVertexEither = titanDao.getVertexById(componentId, filters.detectParseFlag()); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - return getToscaElementByOperation(getVertexEither.left().value(), filters); - } - - public Either getToscaElement(String componentId, JsonParseFlagEnum parseFlag) { - - Either getVertexEither = titanDao.getVertexById(componentId, parseFlag); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - return getToscaElementByOperation(getVertexEither.left().value()); - } - - public Either getToscaElement(GraphVertex componentVertex) { - return getToscaElementByOperation(componentVertex); - } - - public Either validateComponentExists(String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - TitanOperationStatus status = getVertexEither.right().value(); - if (status == TitanOperationStatus.NOT_FOUND) { - return Either.left(false); - } else { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - } - } - return Either.left(true); - } - - public Either findLastCertifiedToscaElementByUUID(T component) { - Map props = new HashMap<>(); - props.put(GraphPropertyEnum.UUID, component.getUUID()); - props.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); - props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - - Either, TitanOperationStatus> getVertexEither = titanDao.getByCriteria(ModelConverter.getVertexType(component), props); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", component.getUniqueId(), getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - return getToscaElementByOperation(getVertexEither.left().value().get(0)); - } - - private Either getToscaElementByOperation(GraphVertex componentV) { - return getToscaElementByOperation(componentV, new ComponentParametersView()); - } - - private Either getToscaElementByOperation(GraphVertex componentV, ComponentParametersView filters) { - VertexTypeEnum label = componentV.getLabel(); - - ToscaElementOperation toscaOperation = getToscaElementOperation(componentV); - Either toscaElement; - String componentId = componentV.getUniqueId(); - if (toscaOperation != null) { - log.debug("Need to fetch tosca element for id {}", componentId); - toscaElement = toscaOperation.getToscaElement(componentV, filters); - } else { - log.debug("not supported tosca type {} for id {}", label, componentId); - toscaElement = Either.right(StorageOperationStatus.BAD_REQUEST); - } - if (toscaElement.isRight()) { - return Either.right(toscaElement.right().value()); - } - return Either.left(ModelConverter.convertFromToscaElement(toscaElement.left().value())); - } - - private ToscaElementOperation getToscaElementOperation(GraphVertex componentV) { - VertexTypeEnum label = componentV.getLabel(); - switch (label) { - case NODE_TYPE: - return nodeTypeOperation; - case TOPOLOGY_TEMPLATE: - return topologyTemplateOperation; - default: - return null; - } - } - - /** - * - * @param resource - * @return - */ - public Either createToscaComponent(T resource) { - ToscaElement toscaElement = ModelConverter.convertToToscaElement(resource); - - ToscaElementOperation toscaElementOperation = getToscaElementOperation(resource); - Either createToscaElement = toscaElementOperation.createToscaElement(toscaElement); - if (createToscaElement.isLeft()) { - log.debug("Component created successfully!!!"); - T dataModel = ModelConverter.convertFromToscaElement(createToscaElement.left().value()); - return Either.left(dataModel); - } - return Either.right(createToscaElement.right().value()); - } - - /** - * - * @param componentToDelete - * @return - */ - public StorageOperationStatus markComponentToDelete(Component componentToDelete) { - - if ((componentToDelete.getIsDeleted() != null) && componentToDelete.getIsDeleted() && !componentToDelete.isHighestVersion()) { - // component already marked for delete - return StorageOperationStatus.OK; - } else { - - Either getResponse = titanDao.getVertexById(componentToDelete.getUniqueId(), JsonParseFlagEnum.ParseAll); - if (getResponse.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentToDelete.getUniqueId(), getResponse.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getResponse.right().value()); - - } - GraphVertex componentV = getResponse.left().value(); - - // same operation for node type and topology template operations - Either result = nodeTypeOperation.markComponentToDelete(componentV); - if (result.isRight()) { - return result.right().value(); - } - return StorageOperationStatus.OK; - } - } - - /** - * - * @param componentId - * @return - */ - public Either deleteToscaComponent(String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component vertex with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - Either deleteElement = deleteToscaElement(getVertexEither.left().value()); - if (deleteElement.isRight()) { - log.debug("Failed to delete component with and unique id {}, error: {}", componentId, deleteElement.right().value()); - return Either.right(deleteElement.right().value()); - } - T dataModel = ModelConverter.convertFromToscaElement(deleteElement.left().value()); - - return Either.left(dataModel); - } - - private Either deleteToscaElement(GraphVertex componentV) { - VertexTypeEnum label = componentV.getLabel(); - Either toscaElement; - Object componentId = componentV.getUniqueId(); - switch (label) { - case NODE_TYPE: - log.debug("Need to fetch node type for id {}", componentId); - toscaElement = nodeTypeOperation.deleteToscaElement(componentV); - break; - case TOPOLOGY_TEMPLATE: - log.debug("Need to fetch topology template for id {}", componentId); - toscaElement = topologyTemplateOperation.deleteToscaElement(componentV); - break; - default: - log.debug("not supported tosca type {} for id {}", label, componentId); - toscaElement = Either.right(StorageOperationStatus.BAD_REQUEST); - break; - } - return toscaElement; - } - - private ToscaElementOperation getToscaElementOperation(Component component) { - return ModelConverter.isAtomicComponent(component) ? nodeTypeOperation : topologyTemplateOperation; - } - - public Either getLatestByToscaResourceName(String toscaResourceName) { - return getLatestByName(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName); - } - + + // region - Fields + + @Autowired + private NodeTypeOperation nodeTypeOperation; + @Autowired + private TopologyTemplateOperation topologyTemplateOperation; + @Autowired + private NodeTemplateOperation nodeTemplateOperation; + @Autowired + private GroupsOperation groupsOperation; + @Autowired + private TitanDao titanDao; + private static Logger log = LoggerFactory.getLogger(ToscaOperationFacade.class.getName()); + // endregion + + // region - ToscaElement - GetById + public static final String PROXY_SUFFIX = "_proxy"; + + public Either getToscaElement(String componentId) { + + return getToscaElement(componentId, JsonParseFlagEnum.ParseAll); + + } + + public Either getToscaFullElement(String componentId) { + ComponentParametersView filters = new ComponentParametersView(); + filters.setIgnoreCapabiltyProperties(false); + + return getToscaElement(componentId, filters); + } + + public Either getToscaElement(String componentId, ComponentParametersView filters) { + + Either getVertexEither = titanDao.getVertexById(componentId, filters.detectParseFlag()); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + return getToscaElementByOperation(getVertexEither.left().value(), filters); + } + + public Either getToscaElement(String componentId, JsonParseFlagEnum parseFlag) { + + Either getVertexEither = titanDao.getVertexById(componentId, parseFlag); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + return getToscaElementByOperation(getVertexEither.left().value()); + } + + public Either getToscaElement(GraphVertex componentVertex) { + return getToscaElementByOperation(componentVertex); + } + + public Either validateComponentExists(String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + TitanOperationStatus status = getVertexEither.right().value(); + if (status == TitanOperationStatus.NOT_FOUND) { + return Either.left(false); + } else { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + } + } + return Either.left(true); + } + + public Either findLastCertifiedToscaElementByUUID(T component) { + Map props = new HashMap<>(); + props.put(GraphPropertyEnum.UUID, component.getUUID()); + props.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + + Either, TitanOperationStatus> getVertexEither = titanDao.getByCriteria(ModelConverter.getVertexType(component), props); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", component.getUniqueId(), getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + return getToscaElementByOperation(getVertexEither.left().value().get(0)); + } + + // endregion + // region - ToscaElement - GetByOperation + private Either getToscaElementByOperation(GraphVertex componentV) { + return getToscaElementByOperation(componentV, new ComponentParametersView()); + } + + private Either getToscaElementByOperation(GraphVertex componentV, ComponentParametersView filters) { + VertexTypeEnum label = componentV.getLabel(); + + ToscaElementOperation toscaOperation = getToscaElementOperation(componentV); + Either toscaElement; + String componentId = componentV.getUniqueId(); + if (toscaOperation != null) { + log.debug("Need to fetch tosca element for id {}", componentId); + toscaElement = toscaOperation.getToscaElement(componentV, filters); + } else { + log.debug("not supported tosca type {} for id {}", label, componentId); + toscaElement = Either.right(StorageOperationStatus.BAD_REQUEST); + } + if (toscaElement.isRight()) { + return Either.right(toscaElement.right().value()); + } + return Either.left(ModelConverter.convertFromToscaElement(toscaElement.left().value())); + } + + // endregion + private ToscaElementOperation getToscaElementOperation(GraphVertex componentV) { + VertexTypeEnum label = componentV.getLabel(); + switch (label) { + case NODE_TYPE: + return nodeTypeOperation; + case TOPOLOGY_TEMPLATE: + return topologyTemplateOperation; + default: + return null; + } + } + + /** + * + * @param resource + * @return + */ + public Either createToscaComponent(T resource) { + ToscaElement toscaElement = ModelConverter.convertToToscaElement(resource); + + ToscaElementOperation toscaElementOperation = getToscaElementOperation(resource); + Either createToscaElement = toscaElementOperation.createToscaElement(toscaElement); + if (createToscaElement.isLeft()) { + log.debug("Component created successfully!!!"); + T dataModel = ModelConverter.convertFromToscaElement(createToscaElement.left().value()); + return Either.left(dataModel); + } + return Either.right(createToscaElement.right().value()); + } + + // region - ToscaElement Delete + /** + * + * @param componentToDelete + * @return + */ + public StorageOperationStatus markComponentToDelete(Component componentToDelete) { + + if ((componentToDelete.getIsDeleted() != null) && componentToDelete.getIsDeleted() && !componentToDelete.isHighestVersion()) { + // component already marked for delete + return StorageOperationStatus.OK; + } else { + + Either getResponse = titanDao.getVertexById(componentToDelete.getUniqueId(), JsonParseFlagEnum.ParseAll); + if (getResponse.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentToDelete.getUniqueId(), getResponse.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getResponse.right().value()); + + } + GraphVertex componentV = getResponse.left().value(); + + // same operation for node type and topology template operations + Either result = nodeTypeOperation.markComponentToDelete(componentV); + if (result.isRight()) { + return result.right().value(); + } + return StorageOperationStatus.OK; + } + } + + /** + * + * @param componentId + * @return + */ + public Either deleteToscaComponent(String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component vertex with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + Either deleteElement = deleteToscaElement(getVertexEither.left().value()); + if (deleteElement.isRight()) { + log.debug("Failed to delete component with and unique id {}, error: {}", componentId, deleteElement.right().value()); + return Either.right(deleteElement.right().value()); + } + T dataModel = ModelConverter.convertFromToscaElement(deleteElement.left().value()); + + return Either.left(dataModel); + } + + private Either deleteToscaElement(GraphVertex componentV) { + VertexTypeEnum label = componentV.getLabel(); + Either toscaElement; + Object componentId = componentV.getUniqueId(); + switch (label) { + case NODE_TYPE: + log.debug("Need to fetch node type for id {}", componentId); + toscaElement = nodeTypeOperation.deleteToscaElement(componentV); + break; + case TOPOLOGY_TEMPLATE: + log.debug("Need to fetch topology template for id {}", componentId); + toscaElement = topologyTemplateOperation.deleteToscaElement(componentV); + break; + default: + log.debug("not supported tosca type {} for id {}", label, componentId); + toscaElement = Either.right(StorageOperationStatus.BAD_REQUEST); + break; + } + return toscaElement; + } + // endregion + + private ToscaElementOperation getToscaElementOperation(Component component) { + return ModelConverter.isAtomicComponent(component) ? nodeTypeOperation : topologyTemplateOperation; + } + + public Either getLatestByToscaResourceName(String toscaResourceName) { + return getLatestByName(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName); + } + public Either getFullLatestComponentByToscaResourceName(String toscaResourceName) { return getLatestByName(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName, JsonParseFlagEnum.ParseAll); } - public Either getLatestByName(String resourceName) { - return getLatestByName(GraphPropertyEnum.NAME, resourceName); + public Either getLatestByName(String resourceName) { + return getLatestByName(GraphPropertyEnum.NAME, resourceName); - } + } - public Either validateCsarUuidUniqueness(String csarUUID) { - Either, StorageOperationStatus> byCsar = null; + public Either validateCsarUuidUniqueness(String csarUUID) { - Map properties = new HashMap(); - properties.put(GraphPropertyEnum.CSAR_UUID, csarUUID); + Map properties = new HashMap(); + properties.put(GraphPropertyEnum.CSAR_UUID, csarUUID); - Either, TitanOperationStatus> resources = titanDao.getByCriteria(null, properties, JsonParseFlagEnum.ParseMetadata); + Either, TitanOperationStatus> resources = titanDao.getByCriteria(null, properties, JsonParseFlagEnum.ParseMetadata); - if (resources.isRight()) { - if (resources.right().value() == TitanOperationStatus.NOT_FOUND) { - return Either.left(new Integer(0)); - } else { - log.debug("failed to get resources from graph with property name: {}", csarUUID); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resources.right().value())); - } - } + if (resources.isRight()) { + if (resources.right().value() == TitanOperationStatus.NOT_FOUND) { + return Either.left(new Integer(0)); + } else { + log.debug("failed to get resources from graph with property name: {}", csarUUID); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resources.right().value())); + } + } - List resourceList = (resources.isLeft() ? resources.left().value() : null); + List resourceList = (resources.isLeft() ? resources.left().value() : null); - return Either.left(new Integer(resourceList.size())); + return Either.left(new Integer(resourceList.size())); - } + } public Either, StorageOperationStatus> getFollowed(String userId, Set lifecycleStates, Set lastStateStates, ComponentTypeEnum componentType) { - Either, StorageOperationStatus> followedResources; - if (componentType == ComponentTypeEnum.RESOURCE) { - followedResources = nodeTypeOperation.getFollowedComponent(userId, lifecycleStates, lastStateStates, componentType); - } else { - followedResources = topologyTemplateOperation.getFollowedComponent(userId, lifecycleStates, lastStateStates, componentType); - } + Either, StorageOperationStatus> followedResources; + if (componentType == ComponentTypeEnum.RESOURCE) { + followedResources = nodeTypeOperation.getFollowedComponent(userId, lifecycleStates, lastStateStates, componentType); + } else { + followedResources = topologyTemplateOperation.getFollowedComponent(userId, lifecycleStates, lastStateStates, componentType); + } Set components = new HashSet<>(); - if (followedResources.isRight() && followedResources.right().value() != StorageOperationStatus.NOT_FOUND) { - return Either.right(followedResources.right().value()); - } - if (followedResources.isLeft()) { - List toscaElements = followedResources.left().value(); - toscaElements.forEach(te -> { - T component = ModelConverter.convertFromToscaElement(te); - components.add(component); - }); - } - return Either.left(components); - } - - public Either getLatestCertifiedNodeTypeByToscaResourceName(String toscaResourceName) { - - return getLatestCertifiedByToscaResourceName(toscaResourceName, VertexTypeEnum.NODE_TYPE, JsonParseFlagEnum.ParseMetadata); - } - - public Either getLatestCertifiedByToscaResourceName(String toscaResourceName, VertexTypeEnum vertexType, JsonParseFlagEnum parseFlag) { - - Either result = null; - Map props = new HashMap(); - props.put(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName); - props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - props.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); - Either, TitanOperationStatus> getLatestRes = titanDao.getByCriteria(vertexType, props, parseFlag); - - if (getLatestRes.isRight()) { - TitanOperationStatus status = getLatestRes.right().value(); - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch {} with name {}. status={} ", vertexType, toscaResourceName, status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - } - if (result == null) { - List resources = getLatestRes.left().value(); - double version = 0.0; - GraphVertex highestResource = null; - for (GraphVertex resource : resources) { - double resourceVersion = Double.parseDouble((String) resource.getJsonMetadataField(JsonPresentationFields.VERSION)); - if (resourceVersion > version) { - version = resourceVersion; - highestResource = resource; - } - } - result = getToscaElement(highestResource.getUniqueId()); - } - return result; - } - - public Either validateToscaResourceNameExists(String templateName) { - Either validateUniquenessRes = validateToscaResourceNameUniqueness(templateName); - if (validateUniquenessRes.isLeft()) { - return Either.left(!validateUniquenessRes.left().value()); - } - return validateUniquenessRes; - } - - public Either dissociateResourceInstances(String componentId, RequirementCapabilityRelDef requirementDef) { - return nodeTemplateOperation.dissociateResourceInstances(componentId, requirementDef); - - } - - public StorageOperationStatus associateResourceInstances(String componentId, List relations) { - Either, StorageOperationStatus> status = nodeTemplateOperation.associateResourceInstances(componentId, relations); - if (status.isRight()) { - return status.right().value(); - } - return StorageOperationStatus.OK; - } - - protected Either validateToscaResourceNameUniqueness(String name) { - - Map properties = new HashMap(); - properties.put(GraphPropertyEnum.TOSCA_RESOURCE_NAME, name); - - Either, TitanOperationStatus> resources = titanDao.getByCriteria(null, properties, JsonParseFlagEnum.ParseMetadata); - - if (resources.isRight() && resources.right().value() != TitanOperationStatus.NOT_FOUND) { - log.debug("failed to get resources from graph with property name: {}", name); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resources.right().value())); - } - List resourceList = (resources.isLeft() ? resources.left().value() : null); - if (resourceList != null && resourceList.size() > 0) { - if (log.isDebugEnabled()) { - StringBuilder builder = new StringBuilder(); - for (GraphVertex resourceData : resourceList) { - builder.append(resourceData.getUniqueId() + "|"); - } - log.debug("resources with property name:{} exists in graph. found {}", name, builder.toString()); - } - return Either.left(false); - } else { - log.debug("resources with property name:{} does not exists in graph", name); - return Either.left(true); - } - - } - - /** - * - * @param newComponent - * @param oldComponent - * @return - */ - public Either overrideComponent(T newComponent, T oldComponent) { - - // TODO - // newComponent.setInterfaces(oldComponent.getInterfaces); - newComponent.setArtifacts(oldComponent.getArtifacts()); - newComponent.setDeploymentArtifacts(oldComponent.getDeploymentArtifacts()); - newComponent.setGroups(oldComponent.getGroups()); - newComponent.setInputs(null); - newComponent.setLastUpdateDate(null); - newComponent.setHighestVersion(true); - - Either componentVEither = titanDao.getVertexById(oldComponent.getUniqueId(), JsonParseFlagEnum.NoParse); - if (componentVEither.isRight()) { - log.debug("Falied to fetch component {} error {}", oldComponent.getUniqueId(), componentVEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(componentVEither.right().value())); - } - GraphVertex componentv = componentVEither.left().value(); - Either parentVertexEither = titanDao.getParentVertex(componentv, EdgeLabelEnum.VERSION, JsonParseFlagEnum.NoParse); - if (parentVertexEither.isRight() && parentVertexEither.right().value() != TitanOperationStatus.NOT_FOUND) { - log.debug("Falied to fetch parent version for component {} error {}", oldComponent.getUniqueId(), parentVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(parentVertexEither.right().value())); - } - - Either deleteToscaComponent = deleteToscaElement(componentv); - if (deleteToscaComponent.isRight()) { - log.debug("Falied to remove old component {} error {}", oldComponent.getUniqueId(), deleteToscaComponent.right().value()); - return Either.right(deleteToscaComponent.right().value()); - } - Either createToscaComponent = createToscaComponent(newComponent); - if (createToscaComponent.isRight()) { - log.debug("Falied to create tosca element component {} error {}", newComponent.getUniqueId(), createToscaComponent.right().value()); - return Either.right(createToscaComponent.right().value()); - } - T newElement = createToscaComponent.left().value(); - Either newVersionEither = titanDao.getVertexById(newElement.getUniqueId(), JsonParseFlagEnum.NoParse); - if (newVersionEither.isRight()) { - log.debug("Falied to fetch new tosca element component {} error {}", newComponent.getUniqueId(), newVersionEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(newVersionEither.right().value())); - } - if (parentVertexEither.isLeft()) { - GraphVertex previousVersionV = parentVertexEither.left().value(); - TitanOperationStatus createEdge = titanDao.createEdge(previousVersionV, newVersionEither.left().value(), EdgeLabelEnum.VERSION, null); - if (createEdge != TitanOperationStatus.OK) { - log.debug("Falied to associate to previous version {} new version {} error {}", previousVersionV.getUniqueId(), newVersionEither.right().value(), createEdge); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(createEdge)); - } - } - return Either.left(newElement); - } - - /** - * - * @param componentToUpdate - * @return - */ - public Either updateToscaElement(T componentToUpdate) { - return updateToscaElement(componentToUpdate, new ComponentParametersView()); - } - - /** - * - * @param componentToUpdate - * @param type - * @param filterResult - * @return - */ - public Either updateToscaElement(T componentToUpdate, ComponentParametersView filterResult) { - String componentId = componentToUpdate.getUniqueId(); - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - } - GraphVertex elementV = getVertexEither.left().value(); - ToscaElementOperation toscaElementOperation = getToscaElementOperation(elementV); - - ToscaElement toscaElementToUpdate = ModelConverter.convertToToscaElement(componentToUpdate); - Either updateToscaElement = toscaElementOperation.updateToscaElement(toscaElementToUpdate, elementV, filterResult); - if (updateToscaElement.isRight()) { - log.debug("Failed to update tosca element {} error {}", componentId, updateToscaElement.right().value()); - return Either.right(updateToscaElement.right().value()); - } - return Either.left(ModelConverter.convertFromToscaElement(updateToscaElement.left().value())); - } - - private Either getLatestByName(GraphPropertyEnum property, String nodeName) { - Either result; - - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - - propertiesToMatch.put(property, nodeName); - propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - - Either, TitanOperationStatus> highestResources = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseMetadata); - if (highestResources.isRight()) { - TitanOperationStatus status = highestResources.right().value(); - log.debug("failed to find resource with name {}. status={} ", nodeName, status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - return result; - } - - List resources = highestResources.left().value(); - double version = 0.0; - GraphVertex highestResource = null; - for (GraphVertex vertex : resources) { - Object versionObj = vertex.getMetadataProperty(GraphPropertyEnum.VERSION); - double resourceVersion = Double.valueOf((String) versionObj); - if (resourceVersion > version) { - version = resourceVersion; - highestResource = vertex; - } - } - return getToscaElementByOperation(highestResource); - } + if (followedResources.isRight() && followedResources.right().value() != StorageOperationStatus.NOT_FOUND) { + return Either.right(followedResources.right().value()); + } + if (followedResources.isLeft()) { + List toscaElements = followedResources.left().value(); + toscaElements.forEach(te -> { + T component = ModelConverter.convertFromToscaElement(te); + components.add(component); + }); + } + return Either.left(components); + } + + public Either getLatestCertifiedNodeTypeByToscaResourceName(String toscaResourceName) { + + return getLatestCertifiedByToscaResourceName(toscaResourceName, VertexTypeEnum.NODE_TYPE, JsonParseFlagEnum.ParseMetadata); + } + + public Either getLatestCertifiedByToscaResourceName(String toscaResourceName, VertexTypeEnum vertexType, JsonParseFlagEnum parseFlag) { + + Either result = null; + Map props = new HashMap(); + props.put(GraphPropertyEnum.TOSCA_RESOURCE_NAME, toscaResourceName); + props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + props.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + Either, TitanOperationStatus> getLatestRes = titanDao.getByCriteria(vertexType, props, parseFlag); + + if (getLatestRes.isRight()) { + TitanOperationStatus status = getLatestRes.right().value(); + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch {} with name {}. status={} ", vertexType, toscaResourceName, status); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + } + if (result == null) { + List resources = getLatestRes.left().value(); + double version = 0.0; + GraphVertex highestResource = null; + for (GraphVertex resource : resources) { + double resourceVersion = Double.parseDouble((String) resource.getJsonMetadataField(JsonPresentationFields.VERSION)); + if (resourceVersion > version) { + version = resourceVersion; + highestResource = resource; + } + } + result = getToscaFullElement(highestResource.getUniqueId()); + } + return result; + } + + public Either validateToscaResourceNameExists(String templateName) { + Either validateUniquenessRes = validateToscaResourceNameUniqueness(templateName); + if (validateUniquenessRes.isLeft()) { + return Either.left(!validateUniquenessRes.left().value()); + } + return validateUniquenessRes; + } + + public Either dissociateResourceInstances(String componentId, RequirementCapabilityRelDef requirementDef) { + return nodeTemplateOperation.dissociateResourceInstances(componentId, requirementDef); + } + /** + * Allows to get fulfilled requirement by relation and received predicate + * @param componentId + * @param instanceId + * @param relation + * @param predicate + * @return + */ + public Either getFulfilledRequirementByRelation(String componentId, String instanceId, RequirementCapabilityRelDef relation, BiPredicate predicate) { + return nodeTemplateOperation.getFulfilledRequirementByRelation(componentId, instanceId, relation, predicate); + } + /** + * Allows to get fulfilled capability by relation and received predicate + * @param componentId + * @param instanceId + * @param relation + * @param predicate + * @return + */ + public Either getFulfilledCapabilityByRelation(String componentId, String instanceId, RequirementCapabilityRelDef relation, BiPredicate predicate) { + return nodeTemplateOperation.getFulfilledCapabilityByRelation(componentId, instanceId, relation, predicate); + } + + public StorageOperationStatus associateResourceInstances(String componentId, List relations) { + Either, StorageOperationStatus> status = nodeTemplateOperation.associateResourceInstances(componentId, relations); + if (status.isRight()) { + return status.right().value(); + } + return StorageOperationStatus.OK; + } + + protected Either validateToscaResourceNameUniqueness(String name) { + + Map properties = new HashMap(); + properties.put(GraphPropertyEnum.TOSCA_RESOURCE_NAME, name); + + Either, TitanOperationStatus> resources = titanDao.getByCriteria(null, properties, JsonParseFlagEnum.ParseMetadata); + + if (resources.isRight() && resources.right().value() != TitanOperationStatus.NOT_FOUND) { + log.debug("failed to get resources from graph with property name: {}", name); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resources.right().value())); + } + List resourceList = (resources.isLeft() ? resources.left().value() : null); + if (resourceList != null && resourceList.size() > 0) { + if (log.isDebugEnabled()) { + StringBuilder builder = new StringBuilder(); + for (GraphVertex resourceData : resourceList) { + builder.append(resourceData.getUniqueId() + "|"); + } + log.debug("resources with property name:{} exists in graph. found {}", name, builder.toString()); + } + return Either.left(false); + } else { + log.debug("resources with property name:{} does not exists in graph", name); + return Either.left(true); + } + + } + + private List getNewInputsByResourceType(Resource component) { + return component.getResourceType().equals(ResourceTypeEnum.CVFC) ? + component.getInputs() : null; + } + + // region - Component Update + /** + * + * @param newComponent + * @param oldComponent + * @return + */ + public Either overrideComponent(Resource newComponent, Resource oldComponent) { + + // TODO + // newComponent.setInterfaces(oldComponent.getInterfaces); + newComponent.setArtifacts(oldComponent.getArtifacts()); + newComponent.setDeploymentArtifacts(oldComponent.getDeploymentArtifacts()); + newComponent.setGroups(oldComponent.getGroups()); + List newInputs = getNewInputsByResourceType(oldComponent); + newComponent.setInputs(newInputs); + newComponent.setLastUpdateDate(null); + newComponent.setHighestVersion(true); + + Either componentVEither = titanDao.getVertexById(oldComponent.getUniqueId(), JsonParseFlagEnum.NoParse); + if (componentVEither.isRight()) { + log.debug("Falied to fetch component {} error {}", oldComponent.getUniqueId(), componentVEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(componentVEither.right().value())); + } + GraphVertex componentv = componentVEither.left().value(); + Either parentVertexEither = titanDao.getParentVertex(componentv, EdgeLabelEnum.VERSION, JsonParseFlagEnum.NoParse); + if (parentVertexEither.isRight() && parentVertexEither.right().value() != TitanOperationStatus.NOT_FOUND) { + log.debug("Falied to fetch parent version for component {} error {}", oldComponent.getUniqueId(), parentVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(parentVertexEither.right().value())); + } + + Either deleteToscaComponent = deleteToscaElement(componentv); + if (deleteToscaComponent.isRight()) { + log.debug("Falied to remove old component {} error {}", oldComponent.getUniqueId(), deleteToscaComponent.right().value()); + return Either.right(deleteToscaComponent.right().value()); + } + Either createToscaComponent = createToscaComponent(newComponent); + if (createToscaComponent.isRight()) { + log.debug("Falied to create tosca element component {} error {}", newComponent.getUniqueId(), createToscaComponent.right().value()); + return Either.right(createToscaComponent.right().value()); + } + Resource newElement = createToscaComponent.left().value(); + Either newVersionEither = titanDao.getVertexById(newElement.getUniqueId(), JsonParseFlagEnum.NoParse); + if (newVersionEither.isRight()) { + log.debug("Falied to fetch new tosca element component {} error {}", newComponent.getUniqueId(), newVersionEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(newVersionEither.right().value())); + } + if (parentVertexEither.isLeft()) { + GraphVertex previousVersionV = parentVertexEither.left().value(); + TitanOperationStatus createEdge = titanDao.createEdge(previousVersionV, newVersionEither.left().value(), EdgeLabelEnum.VERSION, null); + if (createEdge != TitanOperationStatus.OK) { + log.debug("Falied to associate to previous version {} new version {} error {}", previousVersionV.getUniqueId(), newVersionEither.right().value(), createEdge); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(createEdge)); + } + } + return Either.left(newElement); + } + + /** + * + * @param componentToUpdate + * @return + */ + public Either updateToscaElement(T componentToUpdate) { + return updateToscaElement(componentToUpdate, new ComponentParametersView()); + } + + /** + * + * @param componentToUpdate + * @param type + * @param filterResult + * @return + */ + public Either updateToscaElement(T componentToUpdate, ComponentParametersView filterResult) { + String componentId = componentToUpdate.getUniqueId(); + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseAll); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + } + GraphVertex elementV = getVertexEither.left().value(); + ToscaElementOperation toscaElementOperation = getToscaElementOperation(elementV); + + ToscaElement toscaElementToUpdate = ModelConverter.convertToToscaElement(componentToUpdate); + Either updateToscaElement = toscaElementOperation.updateToscaElement(toscaElementToUpdate, elementV, filterResult); + if (updateToscaElement.isRight()) { + log.debug("Failed to update tosca element {} error {}", componentId, updateToscaElement.right().value()); + return Either.right(updateToscaElement.right().value()); + } + return Either.left(ModelConverter.convertFromToscaElement(updateToscaElement.left().value())); + } private Either getLatestByName(GraphPropertyEnum property, String nodeName, JsonParseFlagEnum parseFlag) { Either result; @@ -572,1683 +616,1766 @@ public class ToscaOperationFacade { return getToscaElementByOperation(highestResource); } - public Either, StorageOperationStatus> getBySystemName(ComponentTypeEnum componentType, String systemName) { - - Either, StorageOperationStatus> result = null; - Either getComponentRes; - List components = new ArrayList<>(); - List componentVertices; - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - - propertiesToMatch.put(GraphPropertyEnum.SYSTEM_NAME, systemName); - if (componentType != null) - propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); - - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - - Either, TitanOperationStatus> getComponentsRes = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); - if (getComponentsRes.isRight()) { - TitanOperationStatus status = getComponentsRes.right().value(); - log.debug("Failed to fetch the component with system name {}. Status is {} ", systemName, status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - } - if (result == null) { - componentVertices = getComponentsRes.left().value(); - for (GraphVertex componentVertex : componentVertices) { - getComponentRes = getToscaElementByOperation(componentVertex); - if (getComponentRes.isRight()) { - log.debug("Failed to get the component {}. Status is {} ", componentVertex.getJsonMetadataField(JsonPresentationFields.NAME), getComponentRes.right().value()); - result = Either.right(getComponentRes.right().value()); - break; - } - T componentBySystemName = getComponentRes.left().value(); - log.debug("Found component, id: {}", componentBySystemName.getUniqueId()); - components.add(componentBySystemName); - } - } - if (result == null) { - result = Either.left(components); - } - return result; - } - - public Either getComponentByNameAndVersion(ComponentTypeEnum componentType, String name, String version) { - return getComponentByNameAndVersion(componentType, name, version, JsonParseFlagEnum.ParseAll); - } - - public Either getComponentByNameAndVersion(ComponentTypeEnum componentType, String name, String version, JsonParseFlagEnum parseFlag) { - Either result; - - Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); - Map hasNotProperties = new EnumMap<>(GraphPropertyEnum.class); - - hasProperties.put(GraphPropertyEnum.NAME, name); - hasProperties.put(GraphPropertyEnum.VERSION, version); - hasNotProperties.put(GraphPropertyEnum.IS_DELETED, true); - if (componentType != null) { - hasProperties.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); - } - Either, TitanOperationStatus> getResourceRes = titanDao.getByCriteria(null, hasProperties, hasNotProperties, parseFlag); - if (getResourceRes.isRight()) { - TitanOperationStatus status = getResourceRes.right().value(); - log.debug("failed to find resource with name {}, version {}. Status is {} ", name, version, status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - return result; - } - return getToscaElementByOperation(getResourceRes.left().value().get(0)); - } - - public Either, StorageOperationStatus> getCatalogComponents(ComponentTypeEnum componentType, List excludeTypes, boolean isHighestVersions) { - List components = new ArrayList<>(); - Either, StorageOperationStatus> catalogDataResult; - List toscaElements = new ArrayList<>(); - List excludedResourceTypes = - Optional.ofNullable(excludeTypes).orElse(Collections.emptyList()) - .stream() - .filter(type -> !type.equals(OriginTypeEnum.SERVICE)) - .map(type -> ResourceTypeEnum.getTypeByName(type.name())).collect(Collectors.toList()); - - switch (componentType) { - case RESOURCE: - catalogDataResult = nodeTypeOperation.getElementCatalogData(ComponentTypeEnum.RESOURCE,excludedResourceTypes , isHighestVersions); - if (catalogDataResult.isRight()) { - return Either.right(catalogDataResult.right().value()); - } - toscaElements = catalogDataResult.left().value(); - break; - case SERVICE: - if (excludeTypes!= null && excludeTypes.contains(OriginTypeEnum.SERVICE)) { - break; - } - catalogDataResult = topologyTemplateOperation.getElementCatalogData(ComponentTypeEnum.SERVICE, null, isHighestVersions); - if (catalogDataResult.isRight()) { - return Either.right(catalogDataResult.right().value()); - } - toscaElements = catalogDataResult.left().value(); - break; - default: - log.debug("Not supported component type {}", componentType); - return Either.right(StorageOperationStatus.BAD_REQUEST); - } - toscaElements.forEach(te -> { - T component = ModelConverter.convertFromToscaElement(te); - components.add(component); - }); - return Either.left(components); - } - - public Either, StorageOperationStatus> deleteMarkedElements(ComponentTypeEnum componentType) { - Either, StorageOperationStatus> allComponentsMarkedForDeletion; - List deleted = new ArrayList<>(); - switch (componentType) { - case RESOURCE: - allComponentsMarkedForDeletion = nodeTypeOperation.getAllComponentsMarkedForDeletion(componentType); - break; - case SERVICE: - case PRODUCT: - allComponentsMarkedForDeletion = topologyTemplateOperation.getAllComponentsMarkedForDeletion(componentType); - break; - default: - log.debug("Not supported component type {}", componentType); - return Either.right(StorageOperationStatus.BAD_REQUEST); - } - if (allComponentsMarkedForDeletion.isRight()) { - return Either.right(allComponentsMarkedForDeletion.right().value()); - } - List allMarked = allComponentsMarkedForDeletion.left().value(); - - Either, TitanOperationStatus> allNotDeletedElements = topologyTemplateOperation.getAllNotDeletedElements(); - if (allNotDeletedElements.isRight()) { - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(allNotDeletedElements.right().value())); - } - List allNonMarked = allNotDeletedElements.left().value(); - for (GraphVertex elementV : allMarked) { - if (topologyTemplateOperation.isInUse(elementV, allNonMarked) == false) { - Either deleteToscaElement = deleteToscaElement(elementV); - if (deleteToscaElement.isRight()) { - log.debug("Failed to delete marked element {} error {}", elementV.getUniqueId(), deleteToscaElement.right().value()); - } - } else { - deleted.add(elementV.getUniqueId()); - log.debug("Marked element {} in use. don't delete it", elementV.getUniqueId()); - } - } - return Either.left(deleted); - } - - public Either, StorageOperationStatus> getAllComponentsMarkedForDeletion(ComponentTypeEnum componentType) { - Either, StorageOperationStatus> allComponentsMarkedForDeletion; - switch (componentType) { - case RESOURCE: - allComponentsMarkedForDeletion = nodeTypeOperation.getAllComponentsMarkedForDeletion(componentType); - break; - case SERVICE: - case PRODUCT: - allComponentsMarkedForDeletion = topologyTemplateOperation.getAllComponentsMarkedForDeletion(componentType); - break; - default: - log.debug("Not supported component type {}", componentType); - return Either.right(StorageOperationStatus.BAD_REQUEST); - } - if (allComponentsMarkedForDeletion.isRight()) { - return Either.right(allComponentsMarkedForDeletion.right().value()); - } - return Either.left(allComponentsMarkedForDeletion.left().value().stream().map(v -> v.getUniqueId()).collect(Collectors.toList())); - } - - public Either isComponentInUse(String componentId) { - Either result; - Either, TitanOperationStatus> allNotDeletedElements = topologyTemplateOperation.getAllNotDeletedElements(); - if (allNotDeletedElements.isRight()) { - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(allNotDeletedElements.right().value())); - } else { - result = Either.left(topologyTemplateOperation.isInUse(componentId, allNotDeletedElements.left().value())); - } - return result; - } - - public Either, StorageOperationStatus> addComponentInstanceToTopologyTemplate(Component containerComponent, Component origComponent, ComponentInstance componentInstance, boolean allowDeleted, User user) { - - Either, StorageOperationStatus> result = null; - Either updateContainerComponentRes = null; - componentInstance.setIcon(origComponent.getIcon()); - Either, StorageOperationStatus> addResult = nodeTemplateOperation.addComponentInstanceToTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), - ModelConverter.convertToToscaElement(origComponent), getNextComponentInstanceCounter(containerComponent, origComponent.getName()), componentInstance, allowDeleted, user); - - if (addResult.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the component instance {} to container component {}. ", componentInstance.getName(), containerComponent.getName()); - result = Either.right(addResult.right().value()); - } - if (result == null) { - updateContainerComponentRes = topologyTemplateOperation.getToscaElement(containerComponent.getUniqueId()); - if (updateContainerComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch updated topology template {} with updated component instance {}. ", containerComponent.getName(), componentInstance.getName()); - result = Either.right(updateContainerComponentRes.right().value()); - } - } - if (result == null) { - Component updatedComponent = ModelConverter.convertFromToscaElement(updateContainerComponentRes.left().value()); - String createdInstanceId = addResult.left().value().getRight(); - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The component instance {} has been added to container component {}. ", createdInstanceId, updatedComponent.getName()); - result = Either.left(new ImmutablePair<>(updatedComponent, createdInstanceId)); - } - return result; - } - - public StorageOperationStatus associateComponentInstancesToComponent(Component containerComponent, Map resourcesInstancesMap, boolean allowDeleted) { - - StorageOperationStatus result = null; - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Going to add component instances to component {}", containerComponent.getUniqueId()); - - Either metadataVertex = titanDao.getVertexById(containerComponent.getUniqueId(), JsonParseFlagEnum.ParseAll); - if (metadataVertex.isRight()) { - TitanOperationStatus status = metadataVertex.right().value(); - if (status == TitanOperationStatus.NOT_FOUND) { - status = TitanOperationStatus.INVALID_ID; - } - result = DaoStatusConverter.convertTitanStatusToStorageStatus(status); - } - if (result == null) { - result = nodeTemplateOperation.associateComponentInstancesToComponent(containerComponent, resourcesInstancesMap, metadataVertex.left().value(), allowDeleted); - } - return result; - } - - public Either, StorageOperationStatus> updateComponentInstanceMetadataOfTopologyTemplate(Component containerComponent, Component origComponent, ComponentInstance componentInstance) { - - Either, StorageOperationStatus> result = null; - - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to update the metadata of the component instance {} belonging to container component {}. ", componentInstance.getName(), containerComponent.getName()); - componentInstance.setIcon(origComponent.getIcon()); - Either, StorageOperationStatus> updateResult = nodeTemplateOperation.updateComponentInstanceMetadataOfTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), - ModelConverter.convertToToscaElement(origComponent), componentInstance); - if (updateResult.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the metadata of the component instance {} belonging to container component {}. ", componentInstance.getName(), containerComponent.getName()); - result = Either.right(updateResult.right().value()); - } - if (result == null) { - Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value().getLeft()); - String createdInstanceId = updateResult.left().value().getRight(); - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The metadata of the component instance {} has been updated to container component {}. ", createdInstanceId, updatedComponent.getName()); - result = Either.left(new ImmutablePair<>(updatedComponent, createdInstanceId)); - } - return result; - } - - public Either updateComponentInstanceMetadataOfTopologyTemplate(Component containerComponent) { - - Either result = null; - - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to update the metadata belonging to container component {}. ", containerComponent.getName()); - - Either updateResult = nodeTemplateOperation.updateComponentInstanceMetadataOfTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent)); - if (updateResult.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the metadata belonging to container component {}. ", containerComponent.getName()); - result = Either.right(updateResult.right().value()); - } - if (result == null) { - Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value()); - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The metadata has been updated to container component {}. ", updatedComponent.getName()); - result = Either.left(updatedComponent); - } - return result; - } - - public Either, StorageOperationStatus> deleteComponentInstanceFromTopologyTemplate(Component containerComponent, String resourceInstanceId) { - - Either, StorageOperationStatus> result = null; - - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to delete the component instance {} belonging to container component {}. ", resourceInstanceId, containerComponent.getName()); - - Either, StorageOperationStatus> updateResult = nodeTemplateOperation.deleteComponentInstanceFromTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), resourceInstanceId); - if (updateResult.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to delete the component instance {} belonging to container component {}. ", resourceInstanceId, containerComponent.getName()); - result = Either.right(updateResult.right().value()); - } - if (result == null) { - Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value().getLeft()); - String deletedInstanceId = updateResult.left().value().getRight(); - CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The component instance {} has been deleted from container component {}. ", deletedInstanceId, updatedComponent.getName()); - result = Either.left(new ImmutablePair<>(updatedComponent, deletedInstanceId)); - } - return result; - } - - private String getNextComponentInstanceCounter(Component containerComponent, String originResourceName) { - - Integer nextCounter = 0; - - if (CollectionUtils.isNotEmpty(containerComponent.getComponentInstances())) { - - String normalizedName = ValidationUtils.normalizeComponentInstanceName(originResourceName); - Integer maxCounterFromNames = getMaxCounterFromNames(containerComponent, normalizedName); - Integer maxCounterFromIds = getMaxCounterFromIds(containerComponent, normalizedName); - - if (maxCounterFromNames == null && maxCounterFromIds != null) { - nextCounter = maxCounterFromIds + 1; - } else if (maxCounterFromIds == null && maxCounterFromNames != null) { - nextCounter = maxCounterFromNames + 1; - } else if (maxCounterFromIds != null && maxCounterFromNames != null) { - nextCounter = maxCounterFromNames > maxCounterFromIds ? maxCounterFromNames + 1 : maxCounterFromIds + 1; - } - } - return nextCounter.toString(); - } - - private Integer getMaxCounterFromNames(Component containerComponent, String normalizedName) { - - Integer maxCounter = 0; - List countersStr = containerComponent.getComponentInstances().stream().filter(ci -> ci.getNormalizedName() != null && ci.getNormalizedName().startsWith(normalizedName)).map(ci -> ci.getNormalizedName().split(normalizedName)[1]) - .collect(Collectors.toList()); - - if (CollectionUtils.isEmpty(countersStr)) { - return null; - } - Integer currCounter = null; - for (String counter : countersStr) { - if (StringUtils.isEmpty(counter)) { - continue; - } - try { - currCounter = Integer.parseInt(counter); - } catch (Exception e) { - continue; - } - maxCounter = maxCounter < currCounter ? currCounter : maxCounter; - } - if (currCounter == null) { - return null; - } - return maxCounter; - } - - private Integer getMaxCounterFromIds(Component containerComponent, String normalizedName) { - - Integer maxCounter = 0; - List countersStr = containerComponent.getComponentInstances().stream().filter(ci -> ci.getUniqueId() != null && ci.getUniqueId().contains(normalizedName)).map(ci -> ci.getUniqueId().split(normalizedName)[1]) - .collect(Collectors.toList()); - - if (CollectionUtils.isEmpty(countersStr)) { - return null; - } - Integer currCounter = null; - for (String counter : countersStr) { - if (StringUtils.isEmpty(counter)) { - continue; - } - try { - currCounter = Integer.parseInt(counter); - } catch (Exception e) { - continue; - } - maxCounter = maxCounter < currCounter ? currCounter : maxCounter; - } - if (currCounter == null) { - return null; - } - return maxCounter; - } - - public Either associateResourceInstances(String componentId, RequirementCapabilityRelDef requirementDef) { - return nodeTemplateOperation.associateResourceInstances(componentId, requirementDef); - - } - - public Either, StorageOperationStatus> createAndAssociateInputs(Map inputs, String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - - GraphVertex vertex = getVertexEither.left().value(); - Map inputsMap = inputs.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new PropertyDataDefinition(e.getValue()))); - - StorageOperationStatus status = topologyTemplateOperation.associateInputsToComponent(vertex, inputsMap, componentId); - - if (StorageOperationStatus.OK == status) { - log.debug("Component created successfully!!!"); - List inputsResList = null; - if (inputsMap != null && !inputsMap.isEmpty()) { - inputsResList = inputsMap.values().stream().map(i -> new InputDefinition(i)).collect(Collectors.toList()); - } - return Either.left(inputsResList); - } - return Either.right(status); - - } - - public Either, StorageOperationStatus> addInputsToComponent(Map inputs, String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - - GraphVertex vertex = getVertexEither.left().value(); - Map inputsMap = inputs.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new PropertyDataDefinition(e.getValue()))); - - StorageOperationStatus status = topologyTemplateOperation.addToscaDataToToscaElement(vertex, EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, inputsMap, JsonPresentationFields.NAME); - - if (StorageOperationStatus.OK == status) { - log.debug("Component created successfully!!!"); - List inputsResList = null; - if (inputsMap != null && !inputsMap.isEmpty()) { - inputsResList = inputsMap.values().stream().map(i -> new InputDefinition(i)).collect(Collectors.toList()); - } - return Either.left(inputsResList); - } - return Either.right(status); - - } - - public Either>, StorageOperationStatus> associateComponentInstancePropertiesToComponent(Map> instProperties, String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - - } - - GraphVertex vertex = getVertexEither.left().value(); - Map instPropsMap = new HashMap<>(); - if (instProperties != null) { - - MapPropertiesDataDefinition propertiesMap; - for (Entry> entry : instProperties.entrySet()) { - propertiesMap = new MapPropertiesDataDefinition(); - - propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); - - instPropsMap.put(entry.getKey(), propertiesMap); - } - } - - StorageOperationStatus status = topologyTemplateOperation.associateInstPropertiesToComponent(vertex, instPropsMap); - - if (StorageOperationStatus.OK == status) { - log.debug("Component created successfully!!!"); - return Either.left(instProperties); - } - return Either.right(status); - - } - public Either>, StorageOperationStatus> associateComponentInstanceInputsToComponent(Map> instInputs, String componentId) { + // endregion + // region - Component Get By .. + private Either getLatestByName(GraphPropertyEnum property, String nodeName) { + return getLatestByName(property, nodeName, JsonParseFlagEnum.ParseMetadata); + } - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + public Either, StorageOperationStatus> getBySystemName(ComponentTypeEnum componentType, String systemName) { - } - GraphVertex vertex = getVertexEither.left().value(); - Map instPropsMap = new HashMap<>(); - if (instInputs != null) { + Either, StorageOperationStatus> result = null; + Either getComponentRes; + List components = new ArrayList<>(); + List componentVertices; + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - MapPropertiesDataDefinition propertiesMap; - for (Entry> entry : instInputs.entrySet()) { - propertiesMap = new MapPropertiesDataDefinition(); + propertiesToMatch.put(GraphPropertyEnum.SYSTEM_NAME, systemName); + if (componentType != null) + propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); - propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - instPropsMap.put(entry.getKey(), propertiesMap); + Either, TitanOperationStatus> getComponentsRes = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + if (getComponentsRes.isRight()) { + TitanOperationStatus status = getComponentsRes.right().value(); + log.debug("Failed to fetch the component with system name {}. Status is {} ", systemName, status); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + } + if (result == null) { + componentVertices = getComponentsRes.left().value(); + for (GraphVertex componentVertex : componentVertices) { + getComponentRes = getToscaElementByOperation(componentVertex); + if (getComponentRes.isRight()) { + log.debug("Failed to get the component {}. Status is {} ", componentVertex.getJsonMetadataField(JsonPresentationFields.NAME), getComponentRes.right().value()); + result = Either.right(getComponentRes.right().value()); + break; + } + T componentBySystemName = getComponentRes.left().value(); + log.debug("Found component, id: {}", componentBySystemName.getUniqueId()); + components.add(componentBySystemName); } } - - StorageOperationStatus status = topologyTemplateOperation.associateInstInputsToComponent(vertex, instPropsMap); - - if (StorageOperationStatus.OK == status) { - log.debug("Component created successfully!!!"); - return Either.left(instInputs); + if (result == null) { + result = Either.left(components); } - return Either.right(status); + return result; + } + public Either getComponentByNameAndVersion(ComponentTypeEnum componentType, String name, String version) { + return getComponentByNameAndVersion(componentType, name, version, JsonParseFlagEnum.ParseAll); } - public Either>, StorageOperationStatus> addComponentInstanceInputsToComponent(Component containerComponent, Map> instProperties) { - - StorageOperationStatus status = StorageOperationStatus.OK; - if (instProperties != null) { - - for (Entry> entry : instProperties.entrySet()) { - List props = entry.getValue(); - String componentInstanseId = entry.getKey(); - if (props != null && !props.isEmpty()) { - for (ComponentInstanceInput property : props) { - List componentInstancesInputs = containerComponent.getComponentInstancesInputs().get(componentInstanseId); - Optional instanceProperty = componentInstancesInputs.stream().filter(p -> p.getName().equals(property.getName())).findAny(); - if (instanceProperty.isPresent()) { - status = updateComponentInstanceInput(containerComponent, componentInstanseId, property); - } else { - status = addComponentInstanceInput(containerComponent, componentInstanseId, property); - } - if (status != StorageOperationStatus.OK) { - log.debug("Failed to update instance input {} for instance {} error {} ", property, componentInstanseId, status); - return Either.right(status); - } else { - log.trace("instance input {} for instance {} updated", property, componentInstanseId); - } - } - } - } - } - return Either.left(instProperties); - } - - public StorageOperationStatus deleteComponentInstanceInputsToComponent(Map> instProperties, String componentId) { - - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); - } + public Either getComponentByNameAndVersion(ComponentTypeEnum componentType, String name, String version, JsonParseFlagEnum parseFlag) { + Either result; - GraphVertex vertex = getVertexEither.left().value(); - Map instPropsMap = new HashMap<>(); - if (instProperties != null) { + Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); + Map hasNotProperties = new EnumMap<>(GraphPropertyEnum.class); - MapPropertiesDataDefinition propertiesMap; - for (Entry> entry : instProperties.entrySet()) { - propertiesMap = new MapPropertiesDataDefinition(); + hasProperties.put(GraphPropertyEnum.NAME, name); + hasProperties.put(GraphPropertyEnum.VERSION, version); + hasNotProperties.put(GraphPropertyEnum.IS_DELETED, true); + if (componentType != null) { + hasProperties.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); + } + Either, TitanOperationStatus> getResourceRes = titanDao.getByCriteria(null, hasProperties, hasNotProperties, parseFlag); + if (getResourceRes.isRight()) { + TitanOperationStatus status = getResourceRes.right().value(); + log.debug("failed to find resource with name {}, version {}. Status is {} ", name, version, status); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + return result; + } + return getToscaElementByOperation(getResourceRes.left().value().get(0)); + } - propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + // endregion + public Either, StorageOperationStatus> getCatalogComponents(ComponentTypeEnum componentType, List excludeTypes, boolean isHighestVersions) { + List components = new ArrayList<>(); + Either, StorageOperationStatus> catalogDataResult; + List toscaElements = new ArrayList<>(); + List excludedResourceTypes = Optional.ofNullable(excludeTypes).orElse(Collections.emptyList()).stream().filter(type -> !type.equals(OriginTypeEnum.SERVICE)).map(type -> ResourceTypeEnum.getTypeByName(type.name())) + .collect(Collectors.toList()); + + switch (componentType) { + case RESOURCE: + catalogDataResult = nodeTypeOperation.getElementCatalogData(ComponentTypeEnum.RESOURCE, excludedResourceTypes, isHighestVersions); + if (catalogDataResult.isRight()) { + return Either.right(catalogDataResult.right().value()); + } + toscaElements = catalogDataResult.left().value(); + break; + case SERVICE: + if (excludeTypes != null && excludeTypes.contains(OriginTypeEnum.SERVICE)) { + break; + } + catalogDataResult = topologyTemplateOperation.getElementCatalogData(ComponentTypeEnum.SERVICE, null, isHighestVersions); + if (catalogDataResult.isRight()) { + return Either.right(catalogDataResult.right().value()); + } + toscaElements = catalogDataResult.left().value(); + break; + default: + log.debug("Not supported component type {}", componentType); + return Either.right(StorageOperationStatus.BAD_REQUEST); + } + toscaElements.forEach(te -> { + T component = ModelConverter.convertFromToscaElement(te); + components.add(component); + }); + return Either.left(components); + } - instPropsMap.put(entry.getKey(), propertiesMap); - } - } + public Either, StorageOperationStatus> deleteMarkedElements(ComponentTypeEnum componentType) { + Either, StorageOperationStatus> allComponentsMarkedForDeletion; + List deleted = new ArrayList<>(); + switch (componentType) { + case RESOURCE: + allComponentsMarkedForDeletion = nodeTypeOperation.getAllComponentsMarkedForDeletion(componentType); + break; + case SERVICE: + case PRODUCT: + allComponentsMarkedForDeletion = topologyTemplateOperation.getAllComponentsMarkedForDeletion(componentType); + break; + default: + log.debug("Not supported component type {}", componentType); + return Either.right(StorageOperationStatus.BAD_REQUEST); + } + if (allComponentsMarkedForDeletion.isRight()) { + return Either.right(allComponentsMarkedForDeletion.right().value()); + } + List allMarked = allComponentsMarkedForDeletion.left().value(); - return topologyTemplateOperation.deleteInstInputsToComponent(vertex, instPropsMap); + Either, TitanOperationStatus> allNotDeletedElements = topologyTemplateOperation.getAllNotDeletedElements(); + if (allNotDeletedElements.isRight()) { + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(allNotDeletedElements.right().value())); + } + List allNonMarked = allNotDeletedElements.left().value(); + for (GraphVertex elementV : allMarked) { + if (topologyTemplateOperation.isInUse(elementV, allNonMarked) == false) { + Either deleteToscaElement = deleteToscaElement(elementV); + if (deleteToscaElement.isRight()) { + log.debug("Failed to delete marked element {} error {}", elementV.getUniqueId(), deleteToscaElement.right().value()); + } + } else { + deleted.add(elementV.getUniqueId()); + log.debug("Marked element {} in use. don't delete it", elementV.getUniqueId()); + } + } + return Either.left(deleted); + } - } + public Either, StorageOperationStatus> getAllComponentsMarkedForDeletion(ComponentTypeEnum componentType) { + Either, StorageOperationStatus> allComponentsMarkedForDeletion; + switch (componentType) { + case RESOURCE: + allComponentsMarkedForDeletion = nodeTypeOperation.getAllComponentsMarkedForDeletion(componentType); + break; + case SERVICE: + case PRODUCT: + allComponentsMarkedForDeletion = topologyTemplateOperation.getAllComponentsMarkedForDeletion(componentType); + break; + default: + log.debug("Not supported component type {}", componentType); + return Either.right(StorageOperationStatus.BAD_REQUEST); + } + if (allComponentsMarkedForDeletion.isRight()) { + return Either.right(allComponentsMarkedForDeletion.right().value()); + } + return Either.left(allComponentsMarkedForDeletion.left().value().stream().map(v -> v.getUniqueId()).collect(Collectors.toList())); + } - public Either>, StorageOperationStatus> addComponentInstancePropertiesToComponent(Component containerComponent, Map> instProperties, String componentId) { + public Either isComponentInUse(String componentId) { + Either result; + Either, TitanOperationStatus> allNotDeletedElements = topologyTemplateOperation.getAllNotDeletedElements(); + if (allNotDeletedElements.isRight()) { + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(allNotDeletedElements.right().value())); + } else { + result = Either.left(topologyTemplateOperation.isInUse(componentId, allNotDeletedElements.left().value())); + } + return result; + } - StorageOperationStatus status = StorageOperationStatus.OK; - if (instProperties != null) { + // region - Component Update + public Either, StorageOperationStatus> addComponentInstanceToTopologyTemplate(Component containerComponent, Component origComponent, ComponentInstance componentInstance, boolean allowDeleted, User user) { - for (Entry> entry : instProperties.entrySet()) { - List props = entry.getValue(); - String componentInstanseId = entry.getKey(); - List instanceProperties = containerComponent.getComponentInstancesProperties().get(componentInstanseId); - if (props != null && !props.isEmpty()) { - for (ComponentInstanceProperty property : props) { - Optional instanceProperty = instanceProperties.stream().filter(p -> p.getUniqueId().equals(property.getUniqueId())).findAny(); - if (instanceProperty.isPresent()) { - status = updateComponentInstanceProperty(containerComponent, componentInstanseId, property); - } else { - status = addComponentInstanceProperty(containerComponent, componentInstanseId, property); - } + Either, StorageOperationStatus> result = null; + Either updateContainerComponentRes = null; + if (StringUtils.isEmpty(componentInstance.getIcon())) { + componentInstance.setIcon(origComponent.getIcon()); + } + String nameToFindForCounter = componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy ? PROXY_SUFFIX : origComponent.getName(); + String nextComponentInstanceCounter = getNextComponentInstanceCounter(containerComponent, nameToFindForCounter); + Either, StorageOperationStatus> addResult = nodeTemplateOperation.addComponentInstanceToTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), + ModelConverter.convertToToscaElement(origComponent), nextComponentInstanceCounter, componentInstance, allowDeleted, user); + + if (addResult.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the component instance {} to container component {}. ", componentInstance.getName(), containerComponent.getName()); + result = Either.right(addResult.right().value()); + } + if (result == null) { + updateContainerComponentRes = topologyTemplateOperation.getToscaElement(containerComponent.getUniqueId()); + if (updateContainerComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch updated topology template {} with updated component instance {}. ", containerComponent.getName(), componentInstance.getName()); + result = Either.right(updateContainerComponentRes.right().value()); + } + } + if (result == null) { + Component updatedComponent = ModelConverter.convertFromToscaElement(updateContainerComponentRes.left().value()); + String createdInstanceId = addResult.left().value().getRight(); + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The component instance {} has been added to container component {}. ", createdInstanceId, updatedComponent.getName()); + result = Either.left(new ImmutablePair<>(updatedComponent, createdInstanceId)); + } + return result; + } - } - } - } - } + public StorageOperationStatus associateComponentInstancesToComponent(Component containerComponent, Map resourcesInstancesMap, boolean allowDeleted) { - return Either.left(instProperties); + StorageOperationStatus result = null; + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Going to add component instances to component {}", containerComponent.getUniqueId()); - } + Either metadataVertex = titanDao.getVertexById(containerComponent.getUniqueId(), JsonParseFlagEnum.ParseAll); + if (metadataVertex.isRight()) { + TitanOperationStatus status = metadataVertex.right().value(); + if (status == TitanOperationStatus.NOT_FOUND) { + status = TitanOperationStatus.INVALID_ID; + } + result = DaoStatusConverter.convertTitanStatusToStorageStatus(status); + } + if (result == null) { + result = nodeTemplateOperation.associateComponentInstancesToComponent(containerComponent, resourcesInstancesMap, metadataVertex.left().value(), allowDeleted); + } + return result; + } - public StorageOperationStatus associateDeploymentArtifactsToInstances(Map> instDeploymentArtifacts, String componentId, User user) { + public Either, StorageOperationStatus> updateComponentInstanceMetadataOfTopologyTemplate(Component containerComponent, Component origComponent, ComponentInstance componentInstance) { - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + Either, StorageOperationStatus> result = null; - } + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to update the metadata of the component instance {} belonging to container component {}. ", componentInstance.getName(), containerComponent.getName()); + componentInstance.setIcon(origComponent.getIcon()); + Either, StorageOperationStatus> updateResult = nodeTemplateOperation.updateComponentInstanceMetadataOfTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), + ModelConverter.convertToToscaElement(origComponent), componentInstance); + if (updateResult.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the metadata of the component instance {} belonging to container component {}. ", componentInstance.getName(), containerComponent.getName()); + result = Either.right(updateResult.right().value()); + } + if (result == null) { + Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value().getLeft()); + String createdInstanceId = updateResult.left().value().getRight(); + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The metadata of the component instance {} has been updated to container component {}. ", createdInstanceId, updatedComponent.getName()); + result = Either.left(new ImmutablePair<>(updatedComponent, createdInstanceId)); + } + return result; + } - GraphVertex vertex = getVertexEither.left().value(); - Map instArtMap = new HashMap<>(); - if (instDeploymentArtifacts != null) { + public Either updateComponentInstanceMetadataOfTopologyTemplate(Component containerComponent) { + return updateComponentInstanceMetadataOfTopologyTemplate(containerComponent, new ComponentParametersView()); + } - MapArtifactDataDefinition artifactsMap; - for (Entry> entry : instDeploymentArtifacts.entrySet()) { - Map artList = entry.getValue(); - Map artifacts = artList.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); - artifactsMap = nodeTemplateOperation.prepareInstDeploymentArtifactPerInstance(artifacts, entry.getKey(), user, NodeTemplateOperation.HEAT_VF_ENV_NAME); - - instArtMap.put(entry.getKey(), artifactsMap); - } - } - - return topologyTemplateOperation.associateInstDeploymentArtifactsToComponent(vertex, instArtMap); + public Either updateComponentInstanceMetadataOfTopologyTemplate(Component containerComponent, ComponentParametersView filter) { - } - - public StorageOperationStatus associateArtifactsToInstances(Map> instArtifacts, String componentId, User user) { + Either result = null; - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to update the metadata belonging to container component {}. ", containerComponent.getName()); - } + Either updateResult = nodeTemplateOperation.updateComponentInstanceMetadataOfTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), filter); + if (updateResult.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the metadata belonging to container component {}. ", containerComponent.getName()); + result = Either.right(updateResult.right().value()); + } + if (result == null) { + Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value()); + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The metadata has been updated to container component {}. ", updatedComponent.getName()); + result = Either.left(updatedComponent); + } + return result; + } + // endregion - GraphVertex vertex = getVertexEither.left().value(); - Map instArtMap = new HashMap<>(); - if (instArtifacts != null) { + public Either, StorageOperationStatus> deleteComponentInstanceFromTopologyTemplate(Component containerComponent, String resourceInstanceId) { - MapArtifactDataDefinition artifactsMap; - for (Entry> entry : instArtifacts.entrySet()) { - Map artList = entry.getValue(); - Map artifacts = artList.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); - artifactsMap = new MapArtifactDataDefinition(artifacts); + Either, StorageOperationStatus> result = null; - instArtMap.put(entry.getKey(), artifactsMap); - } - } + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "Going to delete the component instance {} belonging to container component {}. ", resourceInstanceId, containerComponent.getName()); - return topologyTemplateOperation.associateInstArtifactsToComponent(vertex, instArtMap); + Either, StorageOperationStatus> updateResult = nodeTemplateOperation.deleteComponentInstanceFromTopologyTemplate(ModelConverter.convertToToscaElement(containerComponent), resourceInstanceId); + if (updateResult.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to delete the component instance {} belonging to container component {}. ", resourceInstanceId, containerComponent.getName()); + result = Either.right(updateResult.right().value()); + } + if (result == null) { + Component updatedComponent = ModelConverter.convertFromToscaElement(updateResult.left().value().getLeft()); + String deletedInstanceId = updateResult.left().value().getRight(); + CommonUtility.addRecordToLog(log, LogLevelEnum.TRACE, "The component instance {} has been deleted from container component {}. ", deletedInstanceId, updatedComponent.getName()); + result = Either.left(new ImmutablePair<>(updatedComponent, deletedInstanceId)); + } + return result; + } - } + private String getNextComponentInstanceCounter(Component containerComponent, String originResourceName) { - public StorageOperationStatus associateInstAttributeToComponentToInstances(Map> instArttributes, String componentId) { + Integer nextCounter = 0; - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + if (CollectionUtils.isNotEmpty(containerComponent.getComponentInstances())) { - } + String normalizedName = ValidationUtils.normalizeComponentInstanceName(originResourceName); + Integer maxCounterFromNames = getMaxCounterFromNames(containerComponent, normalizedName); + Integer maxCounterFromIds = getMaxCounterFromIds(containerComponent, normalizedName); - GraphVertex vertex = getVertexEither.left().value(); - Map instAttr = new HashMap<>(); - if (instArttributes != null) { + if (maxCounterFromNames == null && maxCounterFromIds != null) { + nextCounter = maxCounterFromIds + 1; + } else if (maxCounterFromIds == null && maxCounterFromNames != null) { + nextCounter = maxCounterFromNames + 1; + } else if (maxCounterFromIds != null && maxCounterFromNames != null) { + nextCounter = maxCounterFromNames > maxCounterFromIds ? maxCounterFromNames + 1 : maxCounterFromIds + 1; + } + } + return nextCounter.toString(); + } - MapPropertiesDataDefinition attributesMap; - for (Entry> entry : instArttributes.entrySet()) { - attributesMap = new MapPropertiesDataDefinition(); - attributesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); - instAttr.put(entry.getKey(), attributesMap); - } - } + private Integer getMaxCounterFromNames(Component containerComponent, String normalizedName) { - return topologyTemplateOperation.associateInstAttributeToComponent(vertex, instAttr); + Integer maxCounter = 0; + List countersStr = containerComponent.getComponentInstances().stream().filter(ci -> ci.getNormalizedName() != null && ci.getNormalizedName().startsWith(normalizedName)).map(ci -> ci.getNormalizedName().split(normalizedName)[1]) + .collect(Collectors.toList()); - } + if (CollectionUtils.isEmpty(countersStr)) { + return null; + } + Integer currCounter = null; + for (String counter : countersStr) { + if (StringUtils.isEmpty(counter)) { + continue; + } + try { + currCounter = Integer.parseInt(counter); + } catch (Exception e) { + continue; + } + maxCounter = maxCounter < currCounter ? currCounter : maxCounter; + } + if (currCounter == null) { + return null; + } + return maxCounter; + } - public StorageOperationStatus associateCalculatedCapReq(Map>> instCapabilties, Map>> instReg, String componentId) { - Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); - if (getVertexEither.isRight()) { - log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); - return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + private Integer getMaxCounterFromIds(Component containerComponent, String normalizedName) { - } + Integer maxCounter = 0; + List countersStr = containerComponent.getComponentInstances().stream().filter(ci -> ci.getUniqueId() != null && ci.getUniqueId().contains(normalizedName)).map(ci -> ci.getUniqueId().split(normalizedName)[1]) + .collect(Collectors.toList()); - GraphVertex vertex = getVertexEither.left().value(); + if (CollectionUtils.isEmpty(countersStr)) { + return null; + } + Integer currCounter = null; + for (String counter : countersStr) { + if (StringUtils.isEmpty(counter)) { + continue; + } + try { + currCounter = Integer.parseInt(counter); + } catch (Exception e) { + continue; + } + maxCounter = maxCounter < currCounter ? currCounter : maxCounter; + } + if (currCounter == null) { + return null; + } + return maxCounter; + } - Map calcRequirements = new HashMap<>(); + public Either associateResourceInstances(String componentId, RequirementCapabilityRelDef requirementDef) { + return nodeTemplateOperation.associateResourceInstances(componentId, requirementDef); - Map calcCapabilty = new HashMap<>(); - Map calculatedCapabilitiesProperties = new HashMap<>(); - ; - if (instCapabilties != null) { - for (Entry>> entry : instCapabilties.entrySet()) { + } - Map> caps = entry.getValue(); - Map mapToscaDataDefinition = new HashMap<>(); - for (Entry> instCapability : caps.entrySet()) { - mapToscaDataDefinition.put(instCapability.getKey(), new ListCapabilityDataDefinition(instCapability.getValue().stream().map(iCap -> new CapabilityDataDefinition(iCap)).collect(Collectors.toList()))); - } - - ComponentInstanceDataDefinition componentInstance = new ComponentInstanceDataDefinition(entry.getKey()); - MapListCapabiltyDataDefinition capMap = nodeTemplateOperation.prepareCalculatedCapabiltyForNodeType(mapToscaDataDefinition, componentInstance); + public Either, StorageOperationStatus> createAndAssociateInputs(Map inputs, String componentId) { - MapCapabiltyProperty mapCapabiltyProperty = ModelConverter.convertToMapOfMapCapabiltyProperties(caps, componentInstance.getUniqueId(), true); - - calcCapabilty.put(entry.getKey().getUniqueId(), capMap); - calculatedCapabilitiesProperties.put(entry.getKey().getUniqueId(), mapCapabiltyProperty); - } - } - - if (instReg != null) { - for (Entry>> entry : instReg.entrySet()) { - - Map> req = entry.getValue(); - Map mapToscaDataDefinition = new HashMap<>(); - for (Entry> instReq : req.entrySet()) { - mapToscaDataDefinition.put(instReq.getKey(), new ListRequirementDataDefinition(instReq.getValue().stream().map(iCap -> new RequirementDataDefinition(iCap)).collect(Collectors.toList()))); - } - - MapListRequirementDataDefinition capMap = nodeTemplateOperation.prepareCalculatedRequirementForNodeType(mapToscaDataDefinition, new ComponentInstanceDataDefinition(entry.getKey())); - - calcRequirements.put(entry.getKey().getUniqueId(), capMap); - } - } - - StorageOperationStatus status = topologyTemplateOperation.associateCalcCapReqToComponent(vertex, calcRequirements, calcCapabilty, calculatedCapabilitiesProperties); - - return status; - } - - private Either, StorageOperationStatus> getLatestVersionNotAbstractToscaElementsMetadataOnly(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, VertexTypeEnum vertexType) { - - Map hasProps = new EnumMap<>(GraphPropertyEnum.class); - Map hasNotProps = new EnumMap<>(GraphPropertyEnum.class); - - fillPropsMap(hasProps, hasNotProps, internalComponentType, componentTypeEnum, isAbstract, vertexType); - - Either, TitanOperationStatus> getRes = titanDao.getByCriteria(vertexType, hasProps, hasNotProps, JsonParseFlagEnum.ParseMetadata); - if (getRes.isRight()) { - if (getRes.right().value().equals(TitanOperationStatus.NOT_FOUND)) { - return Either.left(new ArrayList<>()); - } else { - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); - } - } else { - List nonAbstractLatestComponents = new ArrayList<>(); - ComponentParametersView params = new ComponentParametersView(true); - params.setIgnoreAllVersions(false); - for (GraphVertex vertexComponent : getRes.left().value()) { - Either componentRes = topologyTemplateOperation.getLightComponent(vertexComponent, componentTypeEnum, params); - if (componentRes.isRight()) { - log.debug("Failed to fetch ligth element for {} error {}", vertexComponent.getUniqueId(), componentRes.right().value()); - return Either.right(componentRes.right().value()); - } else { - Component component = ModelConverter.convertFromToscaElement(componentRes.left().value()); - - nonAbstractLatestComponents.add(component); - } - } - - return Either.left(nonAbstractLatestComponents); - } - } - - public Either getLatestComponentMetadataByUuid(String componentUuid, JsonParseFlagEnum parseFlag, Boolean isHighest) { - - Either result; - - Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); - - hasProperties.put(GraphPropertyEnum.UUID, componentUuid); - if (isHighest != null) { - hasProperties.put(GraphPropertyEnum.IS_HIGHEST_VERSION, isHighest.booleanValue()); - } - - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - - Either, TitanOperationStatus> getRes = titanDao.getByCriteria(null, hasProperties, propertiesNotToMatch, parseFlag); - if (getRes.isRight()) { - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); - } else { - List latestVersionList = getRes.left().value().stream().map(ModelConverter::convertToComponentMetadata).collect(Collectors.toList()); - ComponentMetadataData latestVersion = latestVersionList.size() == 1 ? latestVersionList.get(0) - : latestVersionList.stream().max((c1, c2) -> Double.compare(Double.parseDouble(c1.getMetadataDataDefinition().getVersion()), Double.parseDouble(c2.getMetadataDataDefinition().getVersion()))).get(); - result = Either.left(latestVersion); - } - return result; - } - - public Either getComponentMetadata(String componentId) { - - Either result; - Either getRes = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseMetadata); - if (getRes.isRight()) { - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); - } else { - ComponentMetadataData componentMetadata = ModelConverter.convertToComponentMetadata(getRes.left().value()); - result = Either.left(componentMetadata); - } - return result; - } - - private Map findLatestVersion(List resourceDataList) { - Map, ComponentMetadataData> latestVersionMap = new HashMap, ComponentMetadataData>(); - for (ComponentMetadataData resourceData : resourceDataList) { - ComponentMetadataData latestVersionData = resourceData; - - ComponentMetadataDataDefinition metadataDataDefinition = resourceData.getMetadataDataDefinition(); - Pair pair = createKeyPair(latestVersionData); - if (latestVersionMap.containsKey(pair)) { - latestVersionData = latestVersionMap.get(pair); - String currentVersion = latestVersionData.getMetadataDataDefinition().getVersion(); - String newVersion = metadataDataDefinition.getVersion(); - if (CommonBeUtils.compareAsdcComponentVersions(newVersion, currentVersion)) { - latestVersionData = resourceData; - } - } - if (log.isDebugEnabled()) - log.debug("last certified version of resource = {} version is {}", latestVersionData.getMetadataDataDefinition().getName(), latestVersionData.getMetadataDataDefinition().getVersion()); - - latestVersionMap.put(pair, latestVersionData); - } - - Map resVersionMap = new HashMap(); - for (ComponentMetadataData resourceData : latestVersionMap.values()) { - ComponentMetadataData latestVersionData = resourceData; - ComponentMetadataDataDefinition metadataDataDefinition = resourceData.getMetadataDataDefinition(); - if (resVersionMap.containsKey(metadataDataDefinition.getUUID())) { - latestVersionData = resVersionMap.get(metadataDataDefinition.getUUID()); - String currentVersion = latestVersionData.getMetadataDataDefinition().getVersion(); - String newVersion = metadataDataDefinition.getVersion(); - if (CommonBeUtils.compareAsdcComponentVersions(newVersion, currentVersion)) { - latestVersionData = resourceData; - } - } - if (log.isDebugEnabled()) - log.debug("last uuid version of resource = {} version is {}", latestVersionData.getMetadataDataDefinition().getName(), latestVersionData.getMetadataDataDefinition().getVersion()); - resVersionMap.put(latestVersionData.getMetadataDataDefinition().getUUID(), latestVersionData); - } - - return resVersionMap; - } - - private Pair createKeyPair(ComponentMetadataData metadataData) { - Pair pair; - NodeTypeEnum label = NodeTypeEnum.getByName(metadataData.getLabel()); - switch (label) { - case Resource: - pair = new ImmutablePair<>(metadataData.getMetadataDataDefinition().getName(), ((ResourceMetadataDataDefinition) metadataData.getMetadataDataDefinition()).getResourceType().name()); - break; - default: - pair = new ImmutablePair<>(metadataData.getMetadataDataDefinition().getName(), metadataData.getLabel()); - break; - } - - return pair; - } - - public Either, StorageOperationStatus> getLatestVersionNotAbstractComponents(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, List componentUids) { - - Either, StorageOperationStatus> result = null; - List components = new ArrayList<>(); - if (componentUids == null) { - Either, StorageOperationStatus> componentUidsRes = getComponentUids(isAbstract, isHighest, componentTypeEnum, internalComponentType, componentUids); - if (componentUidsRes.isRight()) { - result = Either.right(componentUidsRes.right().value()); - } else { - componentUids = componentUidsRes.left().value(); - } - } - if (!componentUids.isEmpty()) { - for (String componentUid : componentUids) { - ComponentParametersView componentParametersView = buildComponentViewForNotAbstract(); - if (internalComponentType != null && "vl".equalsIgnoreCase(internalComponentType)) { - componentParametersView.setIgnoreCapabilities(false); - componentParametersView.setIgnoreRequirements(false); - } - Either getToscaElementRes = nodeTemplateOperation.getToscaElementOperation(componentTypeEnum).getLightComponent(componentUid, componentTypeEnum, componentParametersView); - if (getToscaElementRes.isRight()) { - if (log.isDebugEnabled()) - log.debug("Failed to fetch resource for error is {}", getToscaElementRes.right().value()); - result = Either.right(getToscaElementRes.right().value()); - break; - } - Component component = ModelConverter.convertFromToscaElement(getToscaElementRes.left().value()); - component.setContactId(null); - component.setCreationDate(null); - component.setCreatorUserId(null); - component.setCreatorFullName(null); - component.setLastUpdateDate(null); - component.setLastUpdaterUserId(null); - component.setLastUpdaterFullName(null); - component.setNormalizedName(null); - components.add(component); - } - } - if (result == null) { - result = Either.left(components); - } - return result; - } - - private Either, StorageOperationStatus> getComponentUids(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, List componentUids) { - - Either, StorageOperationStatus> result = null; - Either, StorageOperationStatus> getToscaElementsRes = getLatestVersionNotAbstractMetadataOnly(isAbstract, isHighest, componentTypeEnum, internalComponentType); - if (getToscaElementsRes.isRight()) { - result = Either.right(getToscaElementsRes.right().value()); - } else { - List collection = getToscaElementsRes.left().value(); - if (collection == null) { - componentUids = new ArrayList<>(); - } else { - componentUids = collection.stream().map(p -> p.getUniqueId()).collect(Collectors.toList()); - } - } - if (result == null) { - result = Either.left(componentUids); - } - return result; - } - - private ComponentParametersView buildComponentViewForNotAbstract() { - ComponentParametersView componentParametersView = new ComponentParametersView(); - componentParametersView.disableAll(); - componentParametersView.setIgnoreCategories(false); - componentParametersView.setIgnoreAllVersions(false); - return componentParametersView; - } - - public Either validateComponentNameExists(String name, ResourceTypeEnum resourceType, ComponentTypeEnum componentType) { - Either result = validateComponentNameUniqueness(name, resourceType, componentType); - if (result.isLeft()) { - result = Either.left(!result.left().value()); - } - return result; - } - - public Either validateComponentNameUniqueness(String name, ResourceTypeEnum resourceType, ComponentTypeEnum componentType) { - VertexTypeEnum vertexType = ModelConverter.isAtomicComponent(resourceType) ? VertexTypeEnum.NODE_TYPE : VertexTypeEnum.TOPOLOGY_TEMPLATE; - String normalizedName = ValidationUtils.normaliseComponentName(name); - Map properties = new EnumMap<>(GraphPropertyEnum.class); - properties.put(GraphPropertyEnum.NORMALIZED_NAME, normalizedName); - properties.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); - - Either, TitanOperationStatus> vertexEither = titanDao.getByCriteria(vertexType, properties, JsonParseFlagEnum.NoParse); - if (vertexEither.isRight() && vertexEither.right().value() != TitanOperationStatus.NOT_FOUND) { - log.debug("failed to get vertex from graph with property normalizedName: {}", normalizedName); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(vertexEither.right().value())); - } - List vertexList = vertexEither.isLeft() ? vertexEither.left().value() : null; - if (vertexList != null && !vertexList.isEmpty()) { - return Either.left(false); - } else { - return Either.left(true); - } - } - - - private void fillNodeTypePropsMap(Map hasProps, Map hasNotProps, String internalComponentType) { - switch (internalComponentType.toLowerCase()) { - case "vf": - case "cvfc": - hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VFCMT.name()); - break; - case "service": - case "pnf" : - hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, Arrays.asList(ResourceTypeEnum.VFC.name(), ResourceTypeEnum.VFCMT.name())); - break; - case "vl": - hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VL.name()); - break; - default: - break; - } - } - + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - private void fillTopologyTemplatePropsMap(Map hasProps, Map hasNotProps, ComponentTypeEnum componentTypeEnum, String internalComponentType) { - switch (componentTypeEnum) { - case RESOURCE: - hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); - break; - case SERVICE: - hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); - break; - default: - break; - } - switch (internalComponentType.toLowerCase()) { - case "vf": - case "cvfc": - hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.CVFC.name()); - break; - case "service": - hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.CVFC.name()); - break; - default: - break; - } - } - - private void fillPropsMap(Map hasProps, Map hasNotProps, String internalComponentType, ComponentTypeEnum componentTypeEnum, boolean isAbstract, VertexTypeEnum internalVertexType) { - hasNotProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name()); - - hasNotProps.put(GraphPropertyEnum.IS_DELETED, true); - hasProps.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - if (VertexTypeEnum.NODE_TYPE == internalVertexType) { - hasProps.put(GraphPropertyEnum.IS_ABSTRACT, isAbstract); - if (internalComponentType != null) { - fillNodeTypePropsMap(hasProps, hasNotProps, internalComponentType); - } - } else { - fillTopologyTemplatePropsMap(hasProps, hasNotProps, componentTypeEnum, internalComponentType); - } - } - - private List getInternalVertexTypes(ComponentTypeEnum componentTypeEnum, String internalComponentType) { - List internalVertexTypes = new ArrayList<>(); - if (ComponentTypeEnum.RESOURCE == componentTypeEnum) { - internalVertexTypes.add(VertexTypeEnum.NODE_TYPE); - } - if (ComponentTypeEnum.SERVICE == componentTypeEnum || "service".equalsIgnoreCase(internalComponentType) || "vf".equalsIgnoreCase(internalComponentType)) { - internalVertexTypes.add(VertexTypeEnum.TOPOLOGY_TEMPLATE); - } - return internalVertexTypes; - } - - public Either, StorageOperationStatus> getLatestVersionNotAbstractMetadataOnly(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType) { - List internalVertexTypes = getInternalVertexTypes(componentTypeEnum, internalComponentType); - List result = new ArrayList<>(); - for (VertexTypeEnum vertexType : internalVertexTypes) { - Either, StorageOperationStatus> listByVertexType = getLatestVersionNotAbstractToscaElementsMetadataOnly(isAbstract, isHighest, componentTypeEnum, internalComponentType, vertexType); - if (listByVertexType.isRight()) { - return listByVertexType; - } - result.addAll(listByVertexType.left().value()); - } - return Either.left(result); - - } - - public Either, StorageOperationStatus> getLatestComponentListByUuid(String componentUuid) { - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - Either, StorageOperationStatus> componentListByUuid = getComponentListByUuid(componentUuid, propertiesToMatch); - return componentListByUuid; - } + } - public Either, StorageOperationStatus> getComponentListByUuid(String componentUuid, Map additionalPropertiesToMatch) { + GraphVertex vertex = getVertexEither.left().value(); + Map inputsMap = inputs.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new PropertyDataDefinition(e.getValue()))); - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + StorageOperationStatus status = topologyTemplateOperation.associateInputsToComponent(vertex, inputsMap, componentId); - if (additionalPropertiesToMatch != null) { - propertiesToMatch.putAll(additionalPropertiesToMatch); - } + if (StorageOperationStatus.OK == status) { + log.debug("Component created successfully!!!"); + List inputsResList = null; + if (inputsMap != null && !inputsMap.isEmpty()) { + inputsResList = inputsMap.values().stream().map(i -> new InputDefinition(i)).collect(Collectors.toList()); + } + return Either.left(inputsResList); + } + return Either.right(status); - propertiesToMatch.put(GraphPropertyEnum.UUID, componentUuid); + } - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + public Either, StorageOperationStatus> addInputsToComponent(Map inputs, String componentId) { - Either, TitanOperationStatus> vertexEither = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); - if (vertexEither.isRight()) { - log.debug("Couldn't fetch metadata for component with type {} and uuid {}, error: {}", componentUuid, vertexEither.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(vertexEither.right().value())); - } - List vertexList = vertexEither.isLeft() ? vertexEither.left().value() : null; + } - if (vertexList == null || vertexList.isEmpty()) { - log.debug("Component with uuid {} was not found", componentUuid); - return Either.right(StorageOperationStatus.NOT_FOUND); - } + GraphVertex vertex = getVertexEither.left().value(); + Map inputsMap = inputs.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new PropertyDataDefinition(e.getValue()))); + + StorageOperationStatus status = topologyTemplateOperation.addToscaDataToToscaElement(vertex, EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, inputsMap, JsonPresentationFields.NAME); + + if (StorageOperationStatus.OK == status) { + log.debug("Component created successfully!!!"); + List inputsResList = null; + if (inputsMap != null && !inputsMap.isEmpty()) { + inputsResList = inputsMap.values().stream().map(i -> new InputDefinition(i)).collect(Collectors.toList()); + } + return Either.left(inputsResList); + } + return Either.right(status); + + } + + public Either, StorageOperationStatus> updateInputsToComponent(List inputs, String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + + GraphVertex vertex = getVertexEither.left().value(); + List inputsAsDataDef = inputs.stream().map(PropertyDataDefinition::new).collect(Collectors.toList()); + + StorageOperationStatus status = topologyTemplateOperation.updateToscaDataOfToscaElement(vertex, EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, inputsAsDataDef, JsonPresentationFields.NAME); + + if (StorageOperationStatus.OK == status) { + log.debug("Component created successfully!!!"); + List inputsResList = null; + if (inputsAsDataDef != null && !inputsAsDataDef.isEmpty()) { + inputsResList = inputsAsDataDef.stream().map(InputDefinition::new).collect(Collectors.toList()); + } + return Either.left(inputsResList); + } + return Either.right(status); + + } + + // region - ComponentInstance + public Either>, StorageOperationStatus> associateComponentInstancePropertiesToComponent(Map> instProperties, String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + + GraphVertex vertex = getVertexEither.left().value(); + Map instPropsMap = new HashMap<>(); + if (instProperties != null) { + + MapPropertiesDataDefinition propertiesMap; + for (Entry> entry : instProperties.entrySet()) { + propertiesMap = new MapPropertiesDataDefinition(); + + propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + + instPropsMap.put(entry.getKey(), propertiesMap); + } + } + + StorageOperationStatus status = topologyTemplateOperation.associateInstPropertiesToComponent(vertex, instPropsMap); + + if (StorageOperationStatus.OK == status) { + log.debug("Component created successfully!!!"); + return Either.left(instProperties); + } + return Either.right(status); + + } + + /** + * saves the instInputs as the updated instance inputs of the component container in DB + * @param instInputs + * @param componentId + * @return + */ + public Either>, StorageOperationStatus> updateComponentInstanceInputsToComponent(Map> instInputs, String componentId) { + if (instInputs == null || instInputs.isEmpty()) { + return Either.left(instInputs); + } + StorageOperationStatus status; + for ( Entry> inputsPerIntance : instInputs.entrySet() ) { + List toscaDataListPerInst = inputsPerIntance.getValue(); + List pathKeysPerInst = new ArrayList<>(); + pathKeysPerInst.add(inputsPerIntance.getKey()); + status = topologyTemplateOperation.updateToscaDataDeepElementsOfToscaElement(componentId, EdgeLabelEnum.INST_INPUTS, VertexTypeEnum.INST_INPUTS, toscaDataListPerInst, pathKeysPerInst, JsonPresentationFields.NAME); + if ( status != StorageOperationStatus.OK) { + log.debug("Failed to update component instance inputs for instance {} in component {} edge type {} error {}", inputsPerIntance.getKey(), componentId, EdgeLabelEnum.INST_INPUTS, status); + return Either.right(status); + } + } + + return Either.left(instInputs); + } + + /** + * saves the instProps as the updated instance properties of the component container in DB + * @param instProps + * @param componentId + * @return + */ + public Either>, StorageOperationStatus> updateComponentInstancePropsToComponent(Map> instProps, String componentId) { + if (instProps == null || instProps.isEmpty()) { + return Either.left(instProps); + } + StorageOperationStatus status; + for ( Entry> propsPerIntance : instProps.entrySet() ) { + List toscaDataListPerInst = propsPerIntance.getValue(); + List pathKeysPerInst = new ArrayList<>(); + pathKeysPerInst.add(propsPerIntance.getKey()); + status = topologyTemplateOperation.updateToscaDataDeepElementsOfToscaElement(componentId, EdgeLabelEnum.INST_PROPERTIES, VertexTypeEnum.INST_PROPERTIES, toscaDataListPerInst, pathKeysPerInst, JsonPresentationFields.NAME); + if ( status != StorageOperationStatus.OK) { + log.debug("Failed to update component instance inputs for instance {} in component {} edge type {} error {}", propsPerIntance.getKey(), componentId, EdgeLabelEnum.INST_PROPERTIES, status); + return Either.right(status); + } + } + + return Either.left(instProps); + } + + public Either>, StorageOperationStatus> associateComponentInstanceInputsToComponent(Map> instInputs, String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value())); + + } + GraphVertex vertex = getVertexEither.left().value(); + Map instPropsMap = new HashMap<>(); + if (instInputs != null) { + + MapPropertiesDataDefinition propertiesMap; + for (Entry> entry : instInputs.entrySet()) { + propertiesMap = new MapPropertiesDataDefinition(); + + propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + + instPropsMap.put(entry.getKey(), propertiesMap); + } + } + + StorageOperationStatus status = topologyTemplateOperation.associateInstInputsToComponent(vertex, instPropsMap); + + if (StorageOperationStatus.OK == status) { + log.debug("Component created successfully!!!"); + return Either.left(instInputs); + } + return Either.right(status); + + } + + public Either>, StorageOperationStatus> addComponentInstanceInputsToComponent(Component containerComponent, Map> instProperties) { + + StorageOperationStatus status = StorageOperationStatus.OK; + if (instProperties != null) { + + for (Entry> entry : instProperties.entrySet()) { + List props = entry.getValue(); + String componentInstanseId = entry.getKey(); + if (props != null && !props.isEmpty()) { + for (ComponentInstanceInput property : props) { + List componentInstancesInputs = containerComponent.getComponentInstancesInputs().get(componentInstanseId); + Optional instanceProperty = componentInstancesInputs.stream().filter(p -> p.getName().equals(property.getName())).findAny(); + if (instanceProperty.isPresent()) { + status = updateComponentInstanceInput(containerComponent, componentInstanseId, property); + } else { + status = addComponentInstanceInput(containerComponent, componentInstanseId, property); + } + if (status != StorageOperationStatus.OK) { + log.debug("Failed to update instance input {} for instance {} error {} ", property, componentInstanseId, status); + return Either.right(status); + } else { + log.trace("instance input {} for instance {} updated", property, componentInstanseId); + } + } + } + } + } + return Either.left(instProperties); + } + + public StorageOperationStatus deleteComponentInstanceInputsToComponent(Map> instProperties, String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + + } + + GraphVertex vertex = getVertexEither.left().value(); + Map instPropsMap = new HashMap<>(); + if (instProperties != null) { + + MapPropertiesDataDefinition propertiesMap; + for (Entry> entry : instProperties.entrySet()) { + propertiesMap = new MapPropertiesDataDefinition(); + + propertiesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + + instPropsMap.put(entry.getKey(), propertiesMap); + } + } + + return topologyTemplateOperation.deleteInstInputsToComponent(vertex, instPropsMap); + + } + + public Either>, StorageOperationStatus> addComponentInstancePropertiesToComponent(Component containerComponent, Map> instProperties, String componentId) { + + if (instProperties != null) { + + for (Entry> entry : instProperties.entrySet()) { + List props = entry.getValue(); + String componentInstanseId = entry.getKey(); + List instanceProperties = containerComponent.getComponentInstancesProperties().get(componentInstanseId); + if (props != null && !props.isEmpty()) { + for (ComponentInstanceProperty property : props) { + Optional instanceProperty = instanceProperties.stream().filter(p -> p.getUniqueId().equals(property.getUniqueId())).findAny(); + if (instanceProperty.isPresent()) { + updateComponentInstanceProperty(containerComponent, componentInstanseId, property); + } else { + addComponentInstanceProperty(containerComponent, componentInstanseId, property); + } + + } + } + } + } + + return Either.left(instProperties); + + } + + public StorageOperationStatus associateDeploymentArtifactsToInstances(Map> instDeploymentArtifacts, String componentId, User user) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + + } + + GraphVertex vertex = getVertexEither.left().value(); + Map instArtMap = new HashMap<>(); + if (instDeploymentArtifacts != null) { + + MapArtifactDataDefinition artifactsMap; + for (Entry> entry : instDeploymentArtifacts.entrySet()) { + Map artList = entry.getValue(); + Map artifacts = artList.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); + artifactsMap = nodeTemplateOperation.prepareInstDeploymentArtifactPerInstance(artifacts, entry.getKey(), user, NodeTemplateOperation.HEAT_VF_ENV_NAME); + + instArtMap.put(entry.getKey(), artifactsMap); + } + } + + return topologyTemplateOperation.associateInstDeploymentArtifactsToComponent(vertex, instArtMap); + + } + + public StorageOperationStatus associateArtifactsToInstances(Map> instArtifacts, String componentId, User user) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + + } + + GraphVertex vertex = getVertexEither.left().value(); + Map instArtMap = new HashMap<>(); + if (instArtifacts != null) { + + MapArtifactDataDefinition artifactsMap; + for (Entry> entry : instArtifacts.entrySet()) { + Map artList = entry.getValue(); + Map artifacts = artList.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); + artifactsMap = new MapArtifactDataDefinition(artifacts); + + instArtMap.put(entry.getKey(), artifactsMap); + } + } + + return topologyTemplateOperation.associateInstArtifactsToComponent(vertex, instArtMap); + + } + + public StorageOperationStatus associateInstAttributeToComponentToInstances(Map> instArttributes, String componentId) { + + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + + } + + GraphVertex vertex = getVertexEither.left().value(); + Map instAttr = new HashMap<>(); + if (instArttributes != null) { + + MapPropertiesDataDefinition attributesMap; + for (Entry> entry : instArttributes.entrySet()) { + attributesMap = new MapPropertiesDataDefinition(); + attributesMap.setMapToscaDataDefinition(entry.getValue().stream().map(e -> new PropertyDataDefinition(e)).collect(Collectors.toMap(e -> e.getName(), e -> e))); + instAttr.put(entry.getKey(), attributesMap); + } + } + + return topologyTemplateOperation.associateInstAttributeToComponent(vertex, instAttr); + + } + // endregion + + public StorageOperationStatus associateCalculatedCapReq(Map>> instCapabilties, Map>> instReg, String componentId) { + Either getVertexEither = titanDao.getVertexById(componentId, JsonParseFlagEnum.NoParse); + if (getVertexEither.isRight()) { + log.debug("Couldn't fetch component with and unique id {}, error: {}", componentId, getVertexEither.right().value()); + return DaoStatusConverter.convertTitanStatusToStorageStatus(getVertexEither.right().value()); + + } + + GraphVertex vertex = getVertexEither.left().value(); + + Map calcRequirements = new HashMap<>(); + + Map calcCapabilty = new HashMap<>(); + Map calculatedCapabilitiesProperties = new HashMap<>(); + ; + if (instCapabilties != null) { + for (Entry>> entry : instCapabilties.entrySet()) { + + Map> caps = entry.getValue(); + Map mapToscaDataDefinition = new HashMap<>(); + for (Entry> instCapability : caps.entrySet()) { + mapToscaDataDefinition.put(instCapability.getKey(), new ListCapabilityDataDefinition(instCapability.getValue().stream().map(iCap -> new CapabilityDataDefinition(iCap)).collect(Collectors.toList()))); + } + + ComponentInstanceDataDefinition componentInstance = new ComponentInstanceDataDefinition(entry.getKey()); + MapListCapabiltyDataDefinition capMap = nodeTemplateOperation.prepareCalculatedCapabiltyForNodeType(mapToscaDataDefinition, componentInstance); + + MapCapabiltyProperty mapCapabiltyProperty = ModelConverter.convertToMapOfMapCapabiltyProperties(caps, componentInstance.getUniqueId(), true); + + calcCapabilty.put(entry.getKey().getUniqueId(), capMap); + calculatedCapabilitiesProperties.put(entry.getKey().getUniqueId(), mapCapabiltyProperty); + } + } + + if (instReg != null) { + for (Entry>> entry : instReg.entrySet()) { + + Map> req = entry.getValue(); + Map mapToscaDataDefinition = new HashMap<>(); + for (Entry> instReq : req.entrySet()) { + mapToscaDataDefinition.put(instReq.getKey(), new ListRequirementDataDefinition(instReq.getValue().stream().map(iCap -> new RequirementDataDefinition(iCap)).collect(Collectors.toList()))); + } + + MapListRequirementDataDefinition capMap = nodeTemplateOperation.prepareCalculatedRequirementForNodeType(mapToscaDataDefinition, new ComponentInstanceDataDefinition(entry.getKey())); + + calcRequirements.put(entry.getKey().getUniqueId(), capMap); + } + } + + StorageOperationStatus status = topologyTemplateOperation.associateCalcCapReqToComponent(vertex, calcRequirements, calcCapabilty, calculatedCapabilitiesProperties); + + return status; + } + + private Either, StorageOperationStatus> getLatestVersionNonCheckoutServicesMetadataOnly(Map hasProps, Map hasNotProps) { + List services = new ArrayList<>(); + List states = new ArrayList<>(); + // include props + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + hasProps.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + + // exclude props + states.add(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); + states.add(LifecycleStateEnum.READY_FOR_CERTIFICATION); + states.add(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS); + hasNotProps.put(GraphPropertyEnum.STATE, states); + hasNotProps.put(GraphPropertyEnum.IS_DELETED, true); + return fetchServicesByCriteria(services, hasProps, hasNotProps); + } + + private Either, StorageOperationStatus> getLatestVersionNotAbstractToscaElementsMetadataOnly(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, VertexTypeEnum vertexType) { + List services = null; + Map hasProps = new EnumMap<>(GraphPropertyEnum.class); + Map hasNotProps = new EnumMap<>(GraphPropertyEnum.class); + fillPropsMap(hasProps, hasNotProps, internalComponentType, componentTypeEnum, isAbstract, vertexType); + Either, TitanOperationStatus> getRes = titanDao.getByCriteria(vertexType, hasProps, hasNotProps, JsonParseFlagEnum.ParseMetadata); + if (getRes.isRight()) { + if (getRes.right().value().equals(TitanOperationStatus.NOT_FOUND)) { + return Either.left(new ArrayList<>()); + } else { + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); + } + } else { + // region -> Fetch non checked-out services + if (internalComponentType != null && internalComponentType.toLowerCase().trim().equals("service") && VertexTypeEnum.NODE_TYPE == vertexType) { // and NODE_TYPE==vertextype + Either, StorageOperationStatus> result = getLatestVersionNonCheckoutServicesMetadataOnly(new EnumMap<>(GraphPropertyEnum.class), new EnumMap<>(GraphPropertyEnum.class)); + if (result.isRight()) { + log.debug("Failed to fetch services for"); + return Either.right(result.right().value()); + } + services = result.left().value(); + if (CollectionUtils.isEmpty(services) && log.isTraceEnabled()) + log.trace("No relevant services available"); + } + // endregion + List nonAbstractLatestComponents = new ArrayList<>(); + ComponentParametersView params = new ComponentParametersView(true); + params.setIgnoreAllVersions(false); + for (GraphVertex vertexComponent : getRes.left().value()) { + Either componentRes = topologyTemplateOperation.getLightComponent(vertexComponent, componentTypeEnum, params); + if (componentRes.isRight()) { + log.debug("Failed to fetch ligth element for {} error {}", vertexComponent.getUniqueId(), componentRes.right().value()); + return Either.right(componentRes.right().value()); + } else { + Component component = ModelConverter.convertFromToscaElement(componentRes.left().value()); + nonAbstractLatestComponents.add(component); + } + } + if (CollectionUtils.isNotEmpty(services)) + nonAbstractLatestComponents.addAll(services); + return Either.left(nonAbstractLatestComponents); + } + } + + public Either getLatestComponentMetadataByUuid(String componentUuid, JsonParseFlagEnum parseFlag, Boolean isHighest) { + + Either result; + + Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); + + hasProperties.put(GraphPropertyEnum.UUID, componentUuid); + if (isHighest != null) { + hasProperties.put(GraphPropertyEnum.IS_HIGHEST_VERSION, isHighest.booleanValue()); + } + + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + + Either, TitanOperationStatus> getRes = titanDao.getByCriteria(null, hasProperties, propertiesNotToMatch, parseFlag); + if (getRes.isRight()) { + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); + } else { + List latestVersionList = getRes.left().value().stream().map(ModelConverter::convertToComponentMetadata).collect(Collectors.toList()); + ComponentMetadataData latestVersion = latestVersionList.size() == 1 ? latestVersionList.get(0) + : latestVersionList.stream().max((c1, c2) -> Double.compare(Double.parseDouble(c1.getMetadataDataDefinition().getVersion()), Double.parseDouble(c2.getMetadataDataDefinition().getVersion()))).get(); + result = Either.left(latestVersion); + } + return result; + } + + public Either getComponentMetadata(String componentId) { + + Either result; + Either getRes = titanDao.getVertexById(componentId, JsonParseFlagEnum.ParseMetadata); + if (getRes.isRight()) { + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); + } else { + ComponentMetadataData componentMetadata = ModelConverter.convertToComponentMetadata(getRes.left().value()); + result = Either.left(componentMetadata); + } + return result; + } + + public Either, StorageOperationStatus> getLatestVersionNotAbstractComponents(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, List componentUids) { + + Either, StorageOperationStatus> result = null; + List components = new ArrayList<>(); + if (componentUids == null) { + Either, StorageOperationStatus> componentUidsRes = getComponentUids(isAbstract, isHighest, componentTypeEnum, internalComponentType, componentUids); + if (componentUidsRes.isRight()) { + result = Either.right(componentUidsRes.right().value()); + } else { + componentUids = componentUidsRes.left().value(); + } + } + if (!componentUids.isEmpty()) { + for (String componentUid : componentUids) { + ComponentParametersView componentParametersView = buildComponentViewForNotAbstract(); + if (internalComponentType != null && "vl".equalsIgnoreCase(internalComponentType)) { + componentParametersView.setIgnoreCapabilities(false); + componentParametersView.setIgnoreRequirements(false); + } + Either getToscaElementRes = nodeTemplateOperation.getToscaElementOperation(componentTypeEnum).getLightComponent(componentUid, componentTypeEnum, componentParametersView); + if (getToscaElementRes.isRight()) { + if (log.isDebugEnabled()) + log.debug("Failed to fetch resource for error is {}", getToscaElementRes.right().value()); + result = Either.right(getToscaElementRes.right().value()); + break; + } + Component component = ModelConverter.convertFromToscaElement(getToscaElementRes.left().value()); + component.setContactId(null); + component.setCreationDate(null); + component.setCreatorUserId(null); + component.setCreatorFullName(null); + component.setLastUpdateDate(null); + component.setLastUpdaterUserId(null); + component.setLastUpdaterFullName(null); + component.setNormalizedName(null); + components.add(component); + } + } + if (result == null) { + result = Either.left(components); + } + return result; + } + + private Either, StorageOperationStatus> getComponentUids(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType, List componentUids) { + + Either, StorageOperationStatus> result = null; + Either, StorageOperationStatus> getToscaElementsRes = getLatestVersionNotAbstractMetadataOnly(isAbstract, isHighest, componentTypeEnum, internalComponentType); + if (getToscaElementsRes.isRight()) { + result = Either.right(getToscaElementsRes.right().value()); + } else { + List collection = getToscaElementsRes.left().value(); + if (collection == null) { + componentUids = new ArrayList<>(); + } else { + componentUids = collection.stream().map(p -> p.getUniqueId()).collect(Collectors.toList()); + } + } + if (result == null) { + result = Either.left(componentUids); + } + return result; + } + + private ComponentParametersView buildComponentViewForNotAbstract() { + ComponentParametersView componentParametersView = new ComponentParametersView(); + componentParametersView.disableAll(); + componentParametersView.setIgnoreCategories(false); + componentParametersView.setIgnoreAllVersions(false); + return componentParametersView; + } + + public Either validateComponentNameExists(String name, ResourceTypeEnum resourceType, ComponentTypeEnum componentType) { + Either result = validateComponentNameUniqueness(name, resourceType, componentType); + if (result.isLeft()) { + result = Either.left(!result.left().value()); + } + return result; + } + + public Either validateComponentNameUniqueness(String name, ResourceTypeEnum resourceType, ComponentTypeEnum componentType) { + VertexTypeEnum vertexType = ModelConverter.isAtomicComponent(resourceType) ? VertexTypeEnum.NODE_TYPE : VertexTypeEnum.TOPOLOGY_TEMPLATE; + String normalizedName = ValidationUtils.normaliseComponentName(name); + Map properties = new EnumMap<>(GraphPropertyEnum.class); + properties.put(GraphPropertyEnum.NORMALIZED_NAME, normalizedName); + properties.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); + + Either, TitanOperationStatus> vertexEither = titanDao.getByCriteria(vertexType, properties, JsonParseFlagEnum.NoParse); + if (vertexEither.isRight() && vertexEither.right().value() != TitanOperationStatus.NOT_FOUND) { + log.debug("failed to get vertex from graph with property normalizedName: {}", normalizedName); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(vertexEither.right().value())); + } + List vertexList = vertexEither.isLeft() ? vertexEither.left().value() : null; + if (vertexList != null && !vertexList.isEmpty()) { + return Either.left(false); + } else { + return Either.left(true); + } + } + + private void fillNodeTypePropsMap(Map hasProps, Map hasNotProps, String internalComponentType) { + switch (internalComponentType.toLowerCase()) { + case "vf": + case "cvfc": + hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, Arrays.asList(ResourceTypeEnum.VFCMT.name(), ResourceTypeEnum.Configuration.name())); + break; + case "service": + case "pnf": + hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, Arrays.asList(ResourceTypeEnum.VFC.name(), ResourceTypeEnum.VFCMT.name())); + break; + case "vl": + hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.VL.name()); + break; + default: + break; + } + } + + private void fillTopologyTemplatePropsMap(Map hasProps, Map hasNotProps, ComponentTypeEnum componentTypeEnum, String internalComponentType) { + switch (componentTypeEnum) { + case RESOURCE: + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + break; + case SERVICE: + hasProps.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + break; + default: + break; + } + switch (internalComponentType.toLowerCase()) { + case "vf": + case "cvfc": + hasProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.CVFC.name()); + break; + case "service": + hasNotProps.put(GraphPropertyEnum.RESOURCE_TYPE, ResourceTypeEnum.CVFC.name()); + break; + default: + break; + } + } + + private void fillPropsMap(Map hasProps, Map hasNotProps, String internalComponentType, ComponentTypeEnum componentTypeEnum, boolean isAbstract, VertexTypeEnum internalVertexType) { + hasNotProps.put(GraphPropertyEnum.STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name()); + + hasNotProps.put(GraphPropertyEnum.IS_DELETED, true); + hasProps.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + if (VertexTypeEnum.NODE_TYPE == internalVertexType) { + hasProps.put(GraphPropertyEnum.IS_ABSTRACT, isAbstract); + if (internalComponentType != null) { + fillNodeTypePropsMap(hasProps, hasNotProps, internalComponentType); + } + } else { + fillTopologyTemplatePropsMap(hasProps, hasNotProps, componentTypeEnum, internalComponentType); + } + } + + private List getInternalVertexTypes(ComponentTypeEnum componentTypeEnum, String internalComponentType) { + List internalVertexTypes = new ArrayList<>(); + if (ComponentTypeEnum.RESOURCE == componentTypeEnum) { + internalVertexTypes.add(VertexTypeEnum.NODE_TYPE); + } + if (ComponentTypeEnum.SERVICE == componentTypeEnum || "service".equalsIgnoreCase(internalComponentType) || "vf".equalsIgnoreCase(internalComponentType)) { + internalVertexTypes.add(VertexTypeEnum.TOPOLOGY_TEMPLATE); + } + return internalVertexTypes; + } + + public Either, StorageOperationStatus> getLatestVersionNotAbstractMetadataOnly(boolean isAbstract, Boolean isHighest, ComponentTypeEnum componentTypeEnum, String internalComponentType) { + List internalVertexTypes = getInternalVertexTypes(componentTypeEnum, internalComponentType); + List result = new ArrayList<>(); + for (VertexTypeEnum vertexType : internalVertexTypes) { + Either, StorageOperationStatus> listByVertexType = getLatestVersionNotAbstractToscaElementsMetadataOnly(isAbstract, isHighest, componentTypeEnum, internalComponentType, vertexType); + if (listByVertexType.isRight()) { + return listByVertexType; + } + result.addAll(listByVertexType.left().value()); + } + return Either.left(result); + + } + + public Either, StorageOperationStatus> getLatestComponentListByUuid(String componentUuid) { + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + Either, StorageOperationStatus> componentListByUuid = getComponentListByUuid(componentUuid, propertiesToMatch); + return componentListByUuid; + } + + public Either, StorageOperationStatus> getComponentListByUuid(String componentUuid, Map additionalPropertiesToMatch) { + + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + + if (additionalPropertiesToMatch != null) { + propertiesToMatch.putAll(additionalPropertiesToMatch); + } + + propertiesToMatch.put(GraphPropertyEnum.UUID, componentUuid); + + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + + Either, TitanOperationStatus> vertexEither = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + + if (vertexEither.isRight()) { + log.debug("Couldn't fetch metadata for component with type {} and uuid {}, error: {}", componentUuid, vertexEither.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(vertexEither.right().value())); + } + List vertexList = vertexEither.isLeft() ? vertexEither.left().value() : null; + + if (vertexList == null || vertexList.isEmpty()) { + log.debug("Component with uuid {} was not found", componentUuid); + return Either.right(StorageOperationStatus.NOT_FOUND); + } ArrayList latestComponents = new ArrayList<>(); - for (GraphVertex vertex : vertexList) { + for (GraphVertex vertex : vertexList) { Either toscaElementByOperation = getToscaElementByOperation(vertex); - - if(toscaElementByOperation.isRight()){ + + if (toscaElementByOperation.isRight()) { log.debug("Could not fetch the following Component by UUID {}", vertex.getUniqueId()); return Either.right(toscaElementByOperation.right().value()); } - + latestComponents.add(toscaElementByOperation.left().value()); } - - if(latestComponents.size() > 1) { + + if (latestComponents.size() > 1) { for (Component component : latestComponents) { - if(component.isHighestVersion()){ + if (component.isHighestVersion()) { LinkedList highestComponent = new LinkedList<>(); highestComponent.add(component); return Either.left(highestComponent); } } - } - - return Either.left(latestComponents); - } - - public Either getLatestComponentByUuid(String componentUuid) { - - Either, StorageOperationStatus> latestVersionListEither = getLatestComponentListByUuid(componentUuid); - - if (latestVersionListEither.isRight()) { - return Either.right(latestVersionListEither.right().value()); - } - - List latestVersionList = latestVersionListEither.left().value(); - - if (latestVersionList.isEmpty()) { - return Either.right(StorageOperationStatus.NOT_FOUND); - } - Component component = latestVersionList.size() == 1 ? latestVersionList.get(0) : latestVersionList.stream().max((c1, c2) -> Double.compare(Double.parseDouble(c1.getVersion()), Double.parseDouble(c2.getVersion()))).get(); - - return Either.left(component); - } - - public Either, StorageOperationStatus> getAllCertifiedResources(boolean isAbstract, Boolean isHighest) { - - List resources = new ArrayList<>(); - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - - propertiesToMatch.put(GraphPropertyEnum.IS_ABSTRACT, isAbstract); - if (isHighest != null) { - propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, isHighest.booleanValue()); - } - propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); - propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - - Either, TitanOperationStatus> getResourcesRes = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); - - if (getResourcesRes.isRight()) { - log.debug("Failed to fetch all certified resources. Status is {}", getResourcesRes.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getResourcesRes.right().value())); - } - List resourceVerticies = getResourcesRes.left().value(); - for (GraphVertex resourceV : resourceVerticies) { - Either getResourceRes = getToscaElement(resourceV); - if (getResourceRes.isRight()) { - return Either.right(getResourceRes.right().value()); - } - resources.add(getResourceRes.left().value()); - } - return Either.left(resources); - } - - public Either getLatestByNameAndVersion(String name, String version, JsonParseFlagEnum parseFlag) { - Either result; - - Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); - Map hasNotProperties = new EnumMap<>(GraphPropertyEnum.class); - - hasProperties.put(GraphPropertyEnum.NAME, name); - hasProperties.put(GraphPropertyEnum.VERSION, version); - hasProperties.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - - hasNotProperties.put(GraphPropertyEnum.IS_DELETED, true); - - Either, TitanOperationStatus> getResourceRes = titanDao.getByCriteria(null, hasProperties, hasNotProperties, parseFlag); - if (getResourceRes.isRight()) { - TitanOperationStatus status = getResourceRes.right().value(); - log.debug("failed to find resource with name {}, version {}. Status is {} ", name, version, status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - return result; - } - return getToscaElementByOperation(getResourceRes.left().value().get(0)); - } - - public Either getLatestComponentByCsarOrName(ComponentTypeEnum componentType, String csarUUID, String systemName) { - return getLatestComponentByCsarOrName(componentType, csarUUID, systemName, false, JsonParseFlagEnum.ParseAll); - } - - public Either getLatestComponentByCsarOrName(ComponentTypeEnum componentType, String csarUUID, String systemName, boolean allowDeleted, JsonParseFlagEnum parseFlag) { - Map props = new EnumMap<>(GraphPropertyEnum.class); - props.put(GraphPropertyEnum.CSAR_UUID, csarUUID); - props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - if (componentType != null) { - props.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); - } - Map propsHasNot = new EnumMap<>(GraphPropertyEnum.class); - propsHasNot.put(GraphPropertyEnum.IS_DELETED, true); - - GraphVertex resourceMetadataData = null; - List resourceMetadataDataList = null; - Either, TitanOperationStatus> byCsar = titanDao.getByCriteria(null, props, propsHasNot, JsonParseFlagEnum.ParseMetadata); - if (byCsar.isRight()) { - if (TitanOperationStatus.NOT_FOUND == byCsar.right().value()) { - // Fix Defect DE256036 - if (StringUtils.isEmpty(systemName)) { - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.NOT_FOUND)); - } - - props.clear(); - props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - props.put(GraphPropertyEnum.SYSTEM_NAME, systemName); - Either, TitanOperationStatus> bySystemname = titanDao.getByCriteria(null, props, JsonParseFlagEnum.ParseMetadata); - if (bySystemname.isRight()) { - log.debug("getLatestResourceByCsarOrName - Failed to find by system name {} error {} ", systemName, bySystemname.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(bySystemname.right().value())); - } - if (bySystemname.left().value().size() > 2) { - log.debug("getLatestResourceByCsarOrName - getByCriteria(by system name) must return only 2 latest version, but was returned - {}", bySystemname.left().value().size()); - return Either.right(StorageOperationStatus.GENERAL_ERROR); - } - resourceMetadataDataList = bySystemname.left().value(); - if (resourceMetadataDataList.size() == 1) { - resourceMetadataData = resourceMetadataDataList.get(0); - } else { - for (GraphVertex curResource : resourceMetadataDataList) { - if (!((String) curResource.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals("CERTIFIED")) { - resourceMetadataData = curResource; - break; - } - } - } - if (resourceMetadataData == null) { - log.debug("getLatestResourceByCsarOrName - getByCriteria(by system name) returned 2 latest CERTIFIED versions"); - return Either.right(StorageOperationStatus.GENERAL_ERROR); - } - if (resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID) != null && !((String) resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID)).equals(csarUUID)) { - log.debug("getLatestResourceByCsarOrName - same system name {} but different csarUUID. exist {} and new {} ", systemName, resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID), csarUUID); - // correct error will be returned from create flow. with all - // correct audit records!!!!! - return Either.right(StorageOperationStatus.NOT_FOUND); - } - Either resource = getToscaElement((String) resourceMetadataData.getUniqueId()); - return resource; - } - } else { - resourceMetadataDataList = byCsar.left().value(); - if (resourceMetadataDataList.size() > 2) { - log.debug("getLatestResourceByCsarOrName - getByCriteria(by csar) must return only 2 latest version, but was returned - {}", byCsar.left().value().size()); - return Either.right(StorageOperationStatus.GENERAL_ERROR); - } - if (resourceMetadataDataList.size() == 1) { - resourceMetadataData = resourceMetadataDataList.get(0); - } else { - for (GraphVertex curResource : resourceMetadataDataList) { - if (!((String) curResource.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals("CERTIFIED")) { - resourceMetadataData = curResource; - break; - } - } - } - if (resourceMetadataData == null) { - log.debug("getLatestResourceByCsarOrName - getByCriteria(by csar) returned 2 latest CERTIFIED versions"); - return Either.right(StorageOperationStatus.GENERAL_ERROR); - } - Either resource = getToscaElement((String) resourceMetadataData.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID), parseFlag); - return resource; - } - return null; - } - - public Either validateToscaResourceNameExtends(String templateNameCurrent, String templateNameExtends) { - - String currentTemplateNameChecked = templateNameExtends; - - while (currentTemplateNameChecked != null && !currentTemplateNameChecked.equalsIgnoreCase(templateNameCurrent)) { - Either latestByToscaResourceName = getLatestByToscaResourceName(currentTemplateNameChecked); - - if (latestByToscaResourceName.isRight()) { - return latestByToscaResourceName.right().value() == StorageOperationStatus.NOT_FOUND ? Either.left(false) : Either.right(latestByToscaResourceName.right().value()); - } - - Resource value = latestByToscaResourceName.left().value(); - - if (value.getDerivedFrom() != null) { - currentTemplateNameChecked = value.getDerivedFrom().get(0); - } else { - currentTemplateNameChecked = null; - } - } - - return (currentTemplateNameChecked != null && currentTemplateNameChecked.equalsIgnoreCase(templateNameCurrent)) ? Either.left(true) : Either.left(false); - } - - public Either, StorageOperationStatus> fetchMetaDataByResourceType(String resourceType, ComponentParametersView filterBy) { - Map props = new EnumMap<>(GraphPropertyEnum.class); - props.put(GraphPropertyEnum.RESOURCE_TYPE, resourceType); - props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); - Either, TitanOperationStatus> resourcesByTypeEither = titanDao.getByCriteria(null, props, JsonParseFlagEnum.ParseMetadata); - - if (resourcesByTypeEither.isRight()) { - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resourcesByTypeEither.right().value())); - } - - List vertexList = resourcesByTypeEither.left().value(); - List components = new ArrayList<>(); - - for (GraphVertex vertex : vertexList) { - components.add(getToscaElementByOperation(vertex, filterBy).left().value()); - } - - return Either.left(components); - } - - public void commit() { - titanDao.commit(); - } - - public Either updateDistributionStatus(Service service, User user, DistributionStatusEnum distributionStatus) { - Either updateDistributionStatus = topologyTemplateOperation.updateDistributionStatus(service.getUniqueId(), user, distributionStatus); - if (updateDistributionStatus.isRight()) { - return Either.right(updateDistributionStatus.right().value()); - } - GraphVertex serviceV = updateDistributionStatus.left().value(); - service.setDistributionStatus(distributionStatus); - service.setLastUpdateDate((Long) serviceV.getJsonMetadataField(JsonPresentationFields.LAST_UPDATE_DATE)); - return Either.left(service); - } - - public Either updateComponentLastUpdateDateOnGraph(Component component, Long modificationTime) { - - Either result = null; - GraphVertex serviceVertex; - Either updateRes = null; - Either getRes = titanDao.getVertexById(component.getUniqueId(), JsonParseFlagEnum.ParseMetadata); - if (getRes.isRight()) { - TitanOperationStatus status = getRes.right().value(); - log.error("Failed to fetch component {}. status is {}", component.getUniqueId(), status); - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); - } - if (result == null) { - serviceVertex = getRes.left().value(); - long lastUpdateDate = System.currentTimeMillis(); - serviceVertex.setJsonMetadataField(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate); - component.setLastUpdateDate(lastUpdateDate); - updateRes = titanDao.updateVertex(serviceVertex); - if (updateRes.isRight()) { - result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(updateRes.right().value())); - } - } - if (result == null) { - result = Either.left(ModelConverter.convertToComponentMetadata(updateRes.left().value())); - } - return result; - } - - public TitanDao getTitanDao() { - return titanDao; - } - - public Either, StorageOperationStatus> getCertifiedServicesWithDistStatus(Set distStatus) { - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); - - return getServicesWithDistStatus(distStatus, propertiesToMatch); - } - - public Either, StorageOperationStatus> getServicesWithDistStatus(Set distStatus, Map additionalPropertiesToMatch) { - - List servicesAll = new ArrayList<>(); - - Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); - Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); - - if (additionalPropertiesToMatch != null && !additionalPropertiesToMatch.isEmpty()) { - propertiesToMatch.putAll(additionalPropertiesToMatch); - } - - propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); - - propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); - - if (distStatus != null && !distStatus.isEmpty()) { - for (DistributionStatusEnum state : distStatus) { - propertiesToMatch.put(GraphPropertyEnum.DISTRIBUTION_STATUS, state.name()); - Either, StorageOperationStatus> fetchServicesByCriteria = fetchServicesByCriteria(servicesAll, propertiesToMatch, propertiesNotToMatch); - if (fetchServicesByCriteria.isRight()) { - return fetchServicesByCriteria; - } else { - servicesAll = fetchServicesByCriteria.left().value(); - } - } - return Either.left(servicesAll); - } else { - return fetchServicesByCriteria(servicesAll, propertiesToMatch, propertiesNotToMatch); - } - } - - // private Either, StorageOperationStatus> fetchServicesByCriteria(List servicesAll, Map propertiesToMatch, Map propertiesNotToMatch) { - // Either, TitanOperationStatus> getRes = titanDao.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); - // if (getRes.isRight()) { - // if (getRes.right().value() != TitanOperationStatus.NOT_FOUND) { - // CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified services by match properties {} not match properties {} . Status is {}. ", propertiesToMatch, propertiesNotToMatch, getRes.right().value()); - // return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); - // } - // } else { - // for (GraphVertex vertex : getRes.left().value()) { - // Either getServiceRes = getToscaElementByOperation(vertex); - // if (getServiceRes.isRight()) { - // CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified service {}. Status is {}. ", vertex.getJsonMetadataField(JsonPresentationFields.NAME), getServiceRes.right().value()); - // return Either.right(getServiceRes.right().value()); - // } else { - // servicesAll.add((Service) getToscaElementByOperation(vertex).left().value()); - // } - // } - // } - // return Either.left(servicesAll); - // } - - private Either, StorageOperationStatus> fetchServicesByCriteria(List servicesAll, Map propertiesToMatch, Map propertiesNotToMatch) { - Either, TitanOperationStatus> getRes = titanDao.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); - if (getRes.isRight()) { - if (getRes.right().value() != TitanOperationStatus.NOT_FOUND) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified services by match properties {} not match properties {} . Status is {}. ", propertiesToMatch, propertiesNotToMatch, getRes.right().value()); - return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); - } - } else { - for (GraphVertex vertex : getRes.left().value()) { - // Either getServiceRes = getToscaElementByOperation(vertex); - Either getServiceRes = topologyTemplateOperation.getLightComponent(vertex, ComponentTypeEnum.SERVICE, new ComponentParametersView(true)); - - if (getServiceRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified service {}. Status is {}. ", vertex.getJsonMetadataField(JsonPresentationFields.NAME), getServiceRes.right().value()); - return Either.right(getServiceRes.right().value()); - } else { - servicesAll.add(ModelConverter.convertFromToscaElement(getServiceRes.left().value())); - } - } - } - return Either.left(servicesAll); - } - - public void rollback() { - titanDao.rollback(); - } - - public StorageOperationStatus addDeploymentArtifactsToInstance(String componentId, ComponentInstance componentInstance, Map finalDeploymentArtifacts) { - Map instDeplArtifacts = finalDeploymentArtifacts.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); - - return nodeTemplateOperation.addDeploymentArtifactsToInstance(componentId, componentInstance.getUniqueId(), instDeplArtifacts); - } - - public StorageOperationStatus addInformationalArtifactsToInstance(String componentId, ComponentInstance componentInstance, Map artifacts) { - StorageOperationStatus status = StorageOperationStatus.OK; - if(MapUtils.isNotEmpty(artifacts)){ - Map instDeplArtifacts = artifacts.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); - status= nodeTemplateOperation.addInformationalArtifactsToInstance(componentId, componentInstance.getUniqueId(), instDeplArtifacts); - } - return status; - } - - public StorageOperationStatus generateCustomizationUUIDOnInstance(String componentId, String instanceId) { - return nodeTemplateOperation.generateCustomizationUUIDOnInstance(componentId, instanceId); - } - - public StorageOperationStatus generateCustomizationUUIDOnInstanceGroup(String componentId, String instanceId, List groupInstances) { - return nodeTemplateOperation.generateCustomizationUUIDOnInstanceGroup(componentId, instanceId, groupInstances); - } - - public Either addPropertyToResource(String propertyName, PropertyDefinition newPropertyDefinition, Resource resource) { - - Either result = null; - Either getUpdatedComponentRes = null; - newPropertyDefinition.setName(propertyName); - newPropertyDefinition.setParentUniqueId(resource.getUniqueId()); - StorageOperationStatus status = getToscaElementOperation(resource).addToscaDataToToscaElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, newPropertyDefinition, JsonPresentationFields.NAME); - if (status != StorageOperationStatus.OK) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", propertyName, resource.getName(), status); - result = Either.right(status); - } - if (result == null) { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreProperties(false); - getUpdatedComponentRes = getToscaElement(resource.getUniqueId(), filter); - if (getUpdatedComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", resource.getUniqueId(), getUpdatedComponentRes.right().value()); - result = Either.right(status); - } - } - if (result == null) { - PropertyDefinition newProperty = null; - List properties = ((Resource) getUpdatedComponentRes.left().value()).getProperties(); - if (CollectionUtils.isNotEmpty(properties)) { - Optional newPropertyOptional = properties.stream().filter(p -> p.getName().equals(propertyName)).findAny(); - if (newPropertyOptional.isPresent()) { - newProperty = newPropertyOptional.get(); - } - } - if (newProperty == null) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", propertyName, resource.getUniqueId(), StorageOperationStatus.NOT_FOUND); - result = Either.right(StorageOperationStatus.NOT_FOUND); - } else { - result = Either.left(newProperty); - } - } - return result; - } - - public StorageOperationStatus deletePropertyOfResource(Resource resource, String propertyName) { - return getToscaElementOperation(resource).deleteToscaDataElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, propertyName, JsonPresentationFields.NAME); - } - - public StorageOperationStatus deleteAttributeOfResource(Component component, String attributeName) { - return getToscaElementOperation(component).deleteToscaDataElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, attributeName, JsonPresentationFields.NAME); - } - - public StorageOperationStatus deleteInputOfResource(Component resource, String inputName) { - return getToscaElementOperation(resource).deleteToscaDataElement(resource.getUniqueId(), EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, inputName, JsonPresentationFields.NAME); - } - - public Either updatePropertyOfResource(Resource resource, PropertyDefinition newPropertyDefinition) { - - Either getUpdatedComponentRes = null; - Either result = null; - StorageOperationStatus status = getToscaElementOperation(resource).updateToscaDataOfToscaElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, newPropertyDefinition, JsonPresentationFields.NAME); - if (status != StorageOperationStatus.OK) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newPropertyDefinition.getName(), resource.getName(), status); - result = Either.right(status); - } - if (result == null) { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreProperties(false); - getUpdatedComponentRes = getToscaElement(resource.getUniqueId(), filter); - if (getUpdatedComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", resource.getUniqueId(), getUpdatedComponentRes.right().value()); - result = Either.right(status); - } - } - if (result == null) { - Optional newProperty = ((Resource) getUpdatedComponentRes.left().value()).getProperties().stream().filter(p -> p.getName().equals(newPropertyDefinition.getName())).findAny(); - if (newProperty.isPresent()) { - result = Either.left(newProperty.get()); - } else { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newPropertyDefinition.getName(), resource.getUniqueId(), StorageOperationStatus.NOT_FOUND); - result = Either.right(StorageOperationStatus.NOT_FOUND); - } - } - return result; - } - - public Either addAttributeOfResource(Component component, PropertyDefinition newAttributeDef) { - - Either getUpdatedComponentRes = null; - Either result = null; - if (newAttributeDef.getUniqueId() == null || newAttributeDef.getUniqueId().isEmpty()) { - String attUniqueId = UniqueIdBuilder.buildAttributeUid(component.getUniqueId(), newAttributeDef.getName()); - newAttributeDef.setUniqueId(attUniqueId); - } - - StorageOperationStatus status = getToscaElementOperation(component).addToscaDataToToscaElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, newAttributeDef, JsonPresentationFields.NAME); - if (status != StorageOperationStatus.OK) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newAttributeDef.getName(), component.getName(), status); - result = Either.right(status); - } - if (result == null) { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreAttributesFrom(false); - getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); - if (getUpdatedComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); - result = Either.right(status); - } - } - if (result == null) { - Optional newAttribute = ((Resource) getUpdatedComponentRes.left().value()).getAttributes().stream().filter(p -> p.getName().equals(newAttributeDef.getName())).findAny(); - if (newAttribute.isPresent()) { - result = Either.left(newAttribute.get()); - } else { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newAttributeDef.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); - result = Either.right(StorageOperationStatus.NOT_FOUND); - } - } - return result; - } - - public Either updateAttributeOfResource(Component component, PropertyDefinition newAttributeDef) { - - Either getUpdatedComponentRes = null; - Either result = null; - StorageOperationStatus status = getToscaElementOperation(component).updateToscaDataOfToscaElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, newAttributeDef, JsonPresentationFields.NAME); - if (status != StorageOperationStatus.OK) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newAttributeDef.getName(), component.getName(), status); - result = Either.right(status); - } - if (result == null) { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreAttributesFrom(false); - getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); - if (getUpdatedComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); - result = Either.right(status); - } - } - if (result == null) { - Optional newProperty = ((Resource) getUpdatedComponentRes.left().value()).getAttributes().stream().filter(p -> p.getName().equals(newAttributeDef.getName())).findAny(); - if (newProperty.isPresent()) { - result = Either.left(newProperty.get()); - } else { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newAttributeDef.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); - result = Either.right(StorageOperationStatus.NOT_FOUND); - } - } - return result; - } - - public Either updateInputOfComponent(Component component, InputDefinition newInputDefinition) { - - Either getUpdatedComponentRes = null; - Either result = null; - StorageOperationStatus status = getToscaElementOperation(component).updateToscaDataOfToscaElement(component.getUniqueId(), EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, newInputDefinition, JsonPresentationFields.NAME); - if (status != StorageOperationStatus.OK) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the input {} to the component {}. Status is {}. ", newInputDefinition.getName(), component.getName(), status); - result = Either.right(status); - } - if (result == null) { - ComponentParametersView filter = new ComponentParametersView(true); - filter.setIgnoreInputs(false); - getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); - if (getUpdatedComponentRes.isRight()) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); - result = Either.right(status); - } - } - if (result == null) { - Optional updatedInput = getUpdatedComponentRes.left().value().getInputs().stream().filter(p -> p.getName().equals(newInputDefinition.getName())).findAny(); - if (updatedInput.isPresent()) { - result = Either.left(updatedInput.get()); - } else { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently updated inputs {} on the resource {}. Status is {}. ", newInputDefinition.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); - result = Either.right(StorageOperationStatus.NOT_FOUND); - } - } - return result; - } - - /** - * method - ename the group instances after referenced container name renamed - * flow - VF rename -(triggers)-> Group rename - * - * @param containerComponent - container such as service - * @param componentInstance - context component - * @param componentInstanceId - id - * - * @return - successfull/failed status - * **/ - public Either cleanAndAddGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, String componentInstanceId){ - String uniqueId = componentInstance.getUniqueId(); - StorageOperationStatus status = nodeTemplateOperation.deleteToscaDataDeepElementsBlockToToscaElement( containerComponent.getUniqueId(), EdgeLabelEnum.INST_GROUPS, VertexTypeEnum.INST_GROUPS, uniqueId ); - if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to delete group instances for container {}. error {] ", componentInstanceId, status); - return Either.right(status); - } - if(componentInstance.getGroupInstances() != null){ - status = addGroupInstancesToComponentInstance( containerComponent , componentInstance, componentInstance.getGroupInstances() ); - if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { - CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add group instances for container {}. error {] ", componentInstanceId, status); - return Either.right(status); - } - } - return Either.left(status); - } - - public StorageOperationStatus addGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, List groups, Map> groupInstancesArtifacts) { - return nodeTemplateOperation.addGroupInstancesToComponentInstance(containerComponent, componentInstance, groups, groupInstancesArtifacts); - } - - public Either, StorageOperationStatus> updateGroupsOnComponent(Component component, ComponentTypeEnum componentType, List updatedGroups) { - return groupsOperation.updateGroups(component, componentType, updatedGroups); - } - - public Either, StorageOperationStatus> updateGroupInstancesOnComponent(Component component, ComponentTypeEnum componentType, String instanceId, List updatedGroupInstances) { - return groupsOperation.updateGroupInstances(component, componentType, instanceId, updatedGroupInstances); - } - - public StorageOperationStatus addGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, List groupInstances) { - return nodeTemplateOperation.addGroupInstancesToComponentInstance(containerComponent, componentInstance, groupInstances); - } - - public StorageOperationStatus addDeploymentArtifactsToComponentInstance(Component containerComponent, ComponentInstance componentInstance, Map deploymentArtifacts) { - return nodeTemplateOperation.addDeploymentArtifactsToComponentInstance(containerComponent, componentInstance, deploymentArtifacts); - } - - public StorageOperationStatus updateComponentInstanceProperty(Component containerComponent, String componentInstanceId, ComponentInstanceProperty property) { - return nodeTemplateOperation.updateComponentInstanceProperty(containerComponent, componentInstanceId, property); - } - - public StorageOperationStatus addComponentInstanceProperty(Component containerComponent, String componentInstanceId, ComponentInstanceProperty property) { - return nodeTemplateOperation.addComponentInstanceProperty(containerComponent, componentInstanceId, property); - } - - public StorageOperationStatus updateComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { - return nodeTemplateOperation.updateComponentInstanceInput(containerComponent, componentInstanceId, property); - } - - public StorageOperationStatus addComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { - return nodeTemplateOperation.addComponentInstanceInput(containerComponent, componentInstanceId, property); - } - - public void setNodeTypeOperation(NodeTypeOperation nodeTypeOperation) { - this.nodeTypeOperation = nodeTypeOperation; - } - - public void setTopologyTemplateOperation(TopologyTemplateOperation topologyTemplateOperation) { - this.topologyTemplateOperation = topologyTemplateOperation; - } + } + + return Either.left(latestComponents); + } + + public Either getLatestComponentByUuid(String componentUuid) { + + Either, StorageOperationStatus> latestVersionListEither = getLatestComponentListByUuid(componentUuid); + + if (latestVersionListEither.isRight()) { + return Either.right(latestVersionListEither.right().value()); + } + + List latestVersionList = latestVersionListEither.left().value(); + + if (latestVersionList.isEmpty()) { + return Either.right(StorageOperationStatus.NOT_FOUND); + } + Component component = latestVersionList.size() == 1 ? latestVersionList.get(0) : latestVersionList.stream().max((c1, c2) -> Double.compare(Double.parseDouble(c1.getVersion()), Double.parseDouble(c2.getVersion()))).get(); + + return Either.left(component); + } + + public Either, StorageOperationStatus> getAllCertifiedResources(boolean isAbstract, Boolean isHighest) { + + List resources = new ArrayList<>(); + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + + propertiesToMatch.put(GraphPropertyEnum.IS_ABSTRACT, isAbstract); + if (isHighest != null) { + propertiesToMatch.put(GraphPropertyEnum.IS_HIGHEST_VERSION, isHighest.booleanValue()); + } + propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE.name()); + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + + Either, TitanOperationStatus> getResourcesRes = titanDao.getByCriteria(null, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + + if (getResourcesRes.isRight()) { + log.debug("Failed to fetch all certified resources. Status is {}", getResourcesRes.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getResourcesRes.right().value())); + } + List resourceVerticies = getResourcesRes.left().value(); + for (GraphVertex resourceV : resourceVerticies) { + Either getResourceRes = getToscaElement(resourceV); + if (getResourceRes.isRight()) { + return Either.right(getResourceRes.right().value()); + } + resources.add(getResourceRes.left().value()); + } + return Either.left(resources); + } + + public Either getLatestByNameAndVersion(String name, String version, JsonParseFlagEnum parseFlag) { + Either result; + + Map hasProperties = new EnumMap<>(GraphPropertyEnum.class); + Map hasNotProperties = new EnumMap<>(GraphPropertyEnum.class); + + hasProperties.put(GraphPropertyEnum.NAME, name); + hasProperties.put(GraphPropertyEnum.VERSION, version); + hasProperties.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + + hasNotProperties.put(GraphPropertyEnum.IS_DELETED, true); + + Either, TitanOperationStatus> getResourceRes = titanDao.getByCriteria(null, hasProperties, hasNotProperties, parseFlag); + if (getResourceRes.isRight()) { + TitanOperationStatus status = getResourceRes.right().value(); + log.debug("failed to find resource with name {}, version {}. Status is {} ", name, version, status); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + return result; + } + return getToscaElementByOperation(getResourceRes.left().value().get(0)); + } + + public Either getLatestComponentByCsarOrName(ComponentTypeEnum componentType, String csarUUID, String systemName) { + return getLatestComponentByCsarOrName(componentType, csarUUID, systemName, false, JsonParseFlagEnum.ParseAll); + } + + public Either getLatestComponentByCsarOrName(ComponentTypeEnum componentType, String csarUUID, String systemName, boolean allowDeleted, JsonParseFlagEnum parseFlag) { + Map props = new EnumMap<>(GraphPropertyEnum.class); + props.put(GraphPropertyEnum.CSAR_UUID, csarUUID); + props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + if (componentType != null) { + props.put(GraphPropertyEnum.COMPONENT_TYPE, componentType.name()); + } + Map propsHasNot = new EnumMap<>(GraphPropertyEnum.class); + propsHasNot.put(GraphPropertyEnum.IS_DELETED, true); + + GraphVertex resourceMetadataData = null; + List resourceMetadataDataList = null; + Either, TitanOperationStatus> byCsar = titanDao.getByCriteria(null, props, propsHasNot, JsonParseFlagEnum.ParseMetadata); + if (byCsar.isRight()) { + if (TitanOperationStatus.NOT_FOUND == byCsar.right().value()) { + // Fix Defect DE256036 + if (StringUtils.isEmpty(systemName)) { + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(TitanOperationStatus.NOT_FOUND)); + } + + props.clear(); + props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + props.put(GraphPropertyEnum.SYSTEM_NAME, systemName); + Either, TitanOperationStatus> bySystemname = titanDao.getByCriteria(null, props, JsonParseFlagEnum.ParseMetadata); + if (bySystemname.isRight()) { + log.debug("getLatestResourceByCsarOrName - Failed to find by system name {} error {} ", systemName, bySystemname.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(bySystemname.right().value())); + } + if (bySystemname.left().value().size() > 2) { + log.debug("getLatestResourceByCsarOrName - getByCriteria(by system name) must return only 2 latest version, but was returned - {}", bySystemname.left().value().size()); + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + resourceMetadataDataList = bySystemname.left().value(); + if (resourceMetadataDataList.size() == 1) { + resourceMetadataData = resourceMetadataDataList.get(0); + } else { + for (GraphVertex curResource : resourceMetadataDataList) { + if (!((String) curResource.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals("CERTIFIED")) { + resourceMetadataData = curResource; + break; + } + } + } + if (resourceMetadataData == null) { + log.debug("getLatestResourceByCsarOrName - getByCriteria(by system name) returned 2 latest CERTIFIED versions"); + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + if (resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID) != null && !((String) resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID)).equals(csarUUID)) { + log.debug("getLatestResourceByCsarOrName - same system name {} but different csarUUID. exist {} and new {} ", systemName, resourceMetadataData.getJsonMetadataField(JsonPresentationFields.CSAR_UUID), csarUUID); + // correct error will be returned from create flow. with all + // correct audit records!!!!! + return Either.right(StorageOperationStatus.NOT_FOUND); + } + Either resource = getToscaElement((String) resourceMetadataData.getUniqueId()); + return resource; + } + } else { + resourceMetadataDataList = byCsar.left().value(); + if (resourceMetadataDataList.size() > 2) { + log.debug("getLatestResourceByCsarOrName - getByCriteria(by csar) must return only 2 latest version, but was returned - {}", byCsar.left().value().size()); + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + if (resourceMetadataDataList.size() == 1) { + resourceMetadataData = resourceMetadataDataList.get(0); + } else { + for (GraphVertex curResource : resourceMetadataDataList) { + if (!((String) curResource.getJsonMetadataField(JsonPresentationFields.LIFECYCLE_STATE)).equals("CERTIFIED")) { + resourceMetadataData = curResource; + break; + } + } + } + if (resourceMetadataData == null) { + log.debug("getLatestResourceByCsarOrName - getByCriteria(by csar) returned 2 latest CERTIFIED versions"); + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + Either resource = getToscaElement((String) resourceMetadataData.getJsonMetadataField(JsonPresentationFields.UNIQUE_ID), parseFlag); + return resource; + } + return null; + } + + public Either validateToscaResourceNameExtends(String templateNameCurrent, String templateNameExtends) { + + String currentTemplateNameChecked = templateNameExtends; + + while (currentTemplateNameChecked != null && !currentTemplateNameChecked.equalsIgnoreCase(templateNameCurrent)) { + Either latestByToscaResourceName = getLatestByToscaResourceName(currentTemplateNameChecked); + + if (latestByToscaResourceName.isRight()) { + return latestByToscaResourceName.right().value() == StorageOperationStatus.NOT_FOUND ? Either.left(false) : Either.right(latestByToscaResourceName.right().value()); + } + + Resource value = latestByToscaResourceName.left().value(); + + if (value.getDerivedFrom() != null) { + currentTemplateNameChecked = value.getDerivedFrom().get(0); + } else { + currentTemplateNameChecked = null; + } + } + + return (currentTemplateNameChecked != null && currentTemplateNameChecked.equalsIgnoreCase(templateNameCurrent)) ? Either.left(true) : Either.left(false); + } + + public Either, StorageOperationStatus> fetchMetaDataByResourceType(String resourceType, ComponentParametersView filterBy) { + Map props = new EnumMap<>(GraphPropertyEnum.class); + props.put(GraphPropertyEnum.RESOURCE_TYPE, resourceType); + props.put(GraphPropertyEnum.IS_HIGHEST_VERSION, true); + Either, TitanOperationStatus> resourcesByTypeEither = titanDao.getByCriteria(null, props, JsonParseFlagEnum.ParseMetadata); + + if (resourcesByTypeEither.isRight()) { + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(resourcesByTypeEither.right().value())); + } + + List vertexList = resourcesByTypeEither.left().value(); + List components = new ArrayList<>(); + + for (GraphVertex vertex : vertexList) { + components.add(getToscaElementByOperation(vertex, filterBy).left().value()); + } + + return Either.left(components); + } + + public void commit() { + titanDao.commit(); + } + + public Either updateDistributionStatus(Service service, User user, DistributionStatusEnum distributionStatus) { + Either updateDistributionStatus = topologyTemplateOperation.updateDistributionStatus(service.getUniqueId(), user, distributionStatus); + if (updateDistributionStatus.isRight()) { + return Either.right(updateDistributionStatus.right().value()); + } + GraphVertex serviceV = updateDistributionStatus.left().value(); + service.setDistributionStatus(distributionStatus); + service.setLastUpdateDate((Long) serviceV.getJsonMetadataField(JsonPresentationFields.LAST_UPDATE_DATE)); + return Either.left(service); + } + + public Either updateComponentLastUpdateDateOnGraph(Component component, Long modificationTime) { + + Either result = null; + GraphVertex serviceVertex; + Either updateRes = null; + Either getRes = titanDao.getVertexById(component.getUniqueId(), JsonParseFlagEnum.ParseMetadata); + if (getRes.isRight()) { + TitanOperationStatus status = getRes.right().value(); + log.error("Failed to fetch component {}. status is {}", component.getUniqueId(), status); + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(status)); + } + if (result == null) { + serviceVertex = getRes.left().value(); + long lastUpdateDate = System.currentTimeMillis(); + serviceVertex.setJsonMetadataField(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate); + component.setLastUpdateDate(lastUpdateDate); + updateRes = titanDao.updateVertex(serviceVertex); + if (updateRes.isRight()) { + result = Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(updateRes.right().value())); + } + } + if (result == null) { + result = Either.left(ModelConverter.convertToComponentMetadata(updateRes.left().value())); + } + return result; + } + + public TitanDao getTitanDao() { + return titanDao; + } + + public Either, StorageOperationStatus> getCertifiedServicesWithDistStatus(Set distStatus) { + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + propertiesToMatch.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name()); + + return getServicesWithDistStatus(distStatus, propertiesToMatch); + } + + public Either, StorageOperationStatus> getServicesWithDistStatus(Set distStatus, Map additionalPropertiesToMatch) { + + List servicesAll = new ArrayList<>(); + + Map propertiesToMatch = new EnumMap<>(GraphPropertyEnum.class); + Map propertiesNotToMatch = new EnumMap<>(GraphPropertyEnum.class); + + if (additionalPropertiesToMatch != null && !additionalPropertiesToMatch.isEmpty()) { + propertiesToMatch.putAll(additionalPropertiesToMatch); + } + + propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name()); + + propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); + + if (distStatus != null && !distStatus.isEmpty()) { + for (DistributionStatusEnum state : distStatus) { + propertiesToMatch.put(GraphPropertyEnum.DISTRIBUTION_STATUS, state.name()); + Either, StorageOperationStatus> fetchServicesByCriteria = fetchServicesByCriteria(servicesAll, propertiesToMatch, propertiesNotToMatch); + if (fetchServicesByCriteria.isRight()) { + return fetchServicesByCriteria; + } else { + servicesAll = fetchServicesByCriteria.left().value(); + } + } + return Either.left(servicesAll); + } else { + return fetchServicesByCriteria(servicesAll, propertiesToMatch, propertiesNotToMatch); + } + } + + // private Either, StorageOperationStatus> fetchServicesByCriteria(List servicesAll, Map propertiesToMatch, Map propertiesNotToMatch) { + // Either, TitanOperationStatus> getRes = titanDao.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + // if (getRes.isRight()) { + // if (getRes.right().value() != TitanOperationStatus.NOT_FOUND) { + // CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified services by match properties {} not match properties {} . Status is {}. ", propertiesToMatch, propertiesNotToMatch, getRes.right().value()); + // return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); + // } + // } else { + // for (GraphVertex vertex : getRes.left().value()) { + // Either getServiceRes = getToscaElementByOperation(vertex); + // if (getServiceRes.isRight()) { + // CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified service {}. Status is {}. ", vertex.getJsonMetadataField(JsonPresentationFields.NAME), getServiceRes.right().value()); + // return Either.right(getServiceRes.right().value()); + // } else { + // servicesAll.add((Service) getToscaElementByOperation(vertex).left().value()); + // } + // } + // } + // return Either.left(servicesAll); + // } + + private Either, StorageOperationStatus> fetchServicesByCriteria(List servicesAll, Map propertiesToMatch, Map propertiesNotToMatch) { + Either, TitanOperationStatus> getRes = titanDao.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, propertiesToMatch, propertiesNotToMatch, JsonParseFlagEnum.ParseAll); + if (getRes.isRight()) { + if (getRes.right().value() != TitanOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified services by match properties {} not match properties {} . Status is {}. ", propertiesToMatch, propertiesNotToMatch, getRes.right().value()); + return Either.right(DaoStatusConverter.convertTitanStatusToStorageStatus(getRes.right().value())); + } + } else { + for (GraphVertex vertex : getRes.left().value()) { + // Either getServiceRes = getToscaElementByOperation(vertex); + Either getServiceRes = topologyTemplateOperation.getLightComponent(vertex, ComponentTypeEnum.SERVICE, new ComponentParametersView(true)); + + if (getServiceRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to fetch certified service {}. Status is {}. ", vertex.getJsonMetadataField(JsonPresentationFields.NAME), getServiceRes.right().value()); + return Either.right(getServiceRes.right().value()); + } else { + servicesAll.add(ModelConverter.convertFromToscaElement(getServiceRes.left().value())); + } + } + } + return Either.left(servicesAll); + } + + public void rollback() { + titanDao.rollback(); + } + + public StorageOperationStatus addDeploymentArtifactsToInstance(String componentId, ComponentInstance componentInstance, Map finalDeploymentArtifacts) { + Map instDeplArtifacts = finalDeploymentArtifacts.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); + + return nodeTemplateOperation.addDeploymentArtifactsToInstance(componentId, componentInstance.getUniqueId(), instDeplArtifacts); + } + + public StorageOperationStatus addInformationalArtifactsToInstance(String componentId, ComponentInstance componentInstance, Map artifacts) { + StorageOperationStatus status = StorageOperationStatus.OK; + if (MapUtils.isNotEmpty(artifacts)) { + Map instDeplArtifacts = artifacts.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> new ArtifactDataDefinition(e.getValue()))); + status = nodeTemplateOperation.addInformationalArtifactsToInstance(componentId, componentInstance.getUniqueId(), instDeplArtifacts); + } + return status; + } + + public StorageOperationStatus generateCustomizationUUIDOnInstance(String componentId, String instanceId) { + return nodeTemplateOperation.generateCustomizationUUIDOnInstance(componentId, instanceId); + } + + public StorageOperationStatus generateCustomizationUUIDOnInstanceGroup(String componentId, String instanceId, List groupInstances) { + return nodeTemplateOperation.generateCustomizationUUIDOnInstanceGroup(componentId, instanceId, groupInstances); + } + + /* + * adds property to a resource + * @warn this method has SIDE EFFECT on ownerId ,use it with caution + * */ + public Either addPropertyToResource(String propertyName, PropertyDefinition newPropertyDefinition, Resource resource) { + + Either result = null; + Either getUpdatedComponentRes = null; + newPropertyDefinition.setName(propertyName); + // newPropertyDefinition.setParentUniqueId(resource.getUniqueId()); //todo- DELETE me after 10.18, ownerId==null => current resource is the owner. ownerId should be null since coming for the servlet => changing self resource property, assigning a null value actually means that the property has no assigned owner ,therfor current resource is the owner + StorageOperationStatus status = getToscaElementOperation(resource).addToscaDataToToscaElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, newPropertyDefinition, JsonPresentationFields.NAME); + if (status != StorageOperationStatus.OK) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", propertyName, resource.getName(), status); + result = Either.right(status); + } + if (result == null) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreProperties(false); + getUpdatedComponentRes = getToscaElement(resource.getUniqueId(), filter); + if (getUpdatedComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", resource.getUniqueId(), getUpdatedComponentRes.right().value()); + result = Either.right(status); + } + } + if (result == null) { + PropertyDefinition newProperty = null; + List properties = ((Resource) getUpdatedComponentRes.left().value()).getProperties(); + if (CollectionUtils.isNotEmpty(properties)) { + Optional newPropertyOptional = properties.stream().filter(p -> p.getName().equals(propertyName)).findAny(); + if (newPropertyOptional.isPresent()) { + newProperty = newPropertyOptional.get(); + } + } + if (newProperty == null) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", propertyName, resource.getUniqueId(), StorageOperationStatus.NOT_FOUND); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } else { + result = Either.left(newProperty); + } + } + return result; + } + + public StorageOperationStatus deletePropertyOfResource(Resource resource, String propertyName) { + return getToscaElementOperation(resource).deleteToscaDataElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, propertyName, JsonPresentationFields.NAME); + } + + public StorageOperationStatus deleteAttributeOfResource(Component component, String attributeName) { + return getToscaElementOperation(component).deleteToscaDataElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, attributeName, JsonPresentationFields.NAME); + } + + public StorageOperationStatus deleteInputOfResource(Component resource, String inputName) { + return getToscaElementOperation(resource).deleteToscaDataElement(resource.getUniqueId(), EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, inputName, JsonPresentationFields.NAME); + } + + public Either updatePropertyOfResource(Resource resource, PropertyDefinition newPropertyDefinition) { + + Either getUpdatedComponentRes = null; + Either result = null; + StorageOperationStatus status = getToscaElementOperation(resource).updateToscaDataOfToscaElement(resource.getUniqueId(), EdgeLabelEnum.PROPERTIES, VertexTypeEnum.PROPERTIES, newPropertyDefinition, JsonPresentationFields.NAME); + if (status != StorageOperationStatus.OK) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newPropertyDefinition.getName(), resource.getName(), status); + result = Either.right(status); + } + if (result == null) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreProperties(false); + getUpdatedComponentRes = getToscaElement(resource.getUniqueId(), filter); + if (getUpdatedComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", resource.getUniqueId(), getUpdatedComponentRes.right().value()); + result = Either.right(status); + } + } + if (result == null) { + Optional newProperty = ((Resource) getUpdatedComponentRes.left().value()).getProperties().stream().filter(p -> p.getName().equals(newPropertyDefinition.getName())).findAny(); + if (newProperty.isPresent()) { + result = Either.left(newProperty.get()); + } else { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newPropertyDefinition.getName(), resource.getUniqueId(), StorageOperationStatus.NOT_FOUND); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + return result; + } + + public Either addAttributeOfResource(Component component, PropertyDefinition newAttributeDef) { + + Either getUpdatedComponentRes = null; + Either result = null; + if (newAttributeDef.getUniqueId() == null || newAttributeDef.getUniqueId().isEmpty()) { + String attUniqueId = UniqueIdBuilder.buildAttributeUid(component.getUniqueId(), newAttributeDef.getName()); + newAttributeDef.setUniqueId(attUniqueId); + } + + StorageOperationStatus status = getToscaElementOperation(component).addToscaDataToToscaElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, newAttributeDef, JsonPresentationFields.NAME); + if (status != StorageOperationStatus.OK) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newAttributeDef.getName(), component.getName(), status); + result = Either.right(status); + } + if (result == null) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreAttributesFrom(false); + getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); + if (getUpdatedComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); + result = Either.right(status); + } + } + if (result == null) { + Optional newAttribute = ((Resource) getUpdatedComponentRes.left().value()).getAttributes().stream().filter(p -> p.getName().equals(newAttributeDef.getName())).findAny(); + if (newAttribute.isPresent()) { + result = Either.left(newAttribute.get()); + } else { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newAttributeDef.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + return result; + } + + public Either updateAttributeOfResource(Component component, PropertyDefinition newAttributeDef) { + + Either getUpdatedComponentRes = null; + Either result = null; + StorageOperationStatus status = getToscaElementOperation(component).updateToscaDataOfToscaElement(component.getUniqueId(), EdgeLabelEnum.ATTRIBUTES, VertexTypeEnum.ATTRIBUTES, newAttributeDef, JsonPresentationFields.NAME); + if (status != StorageOperationStatus.OK) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add the property {} to the resource {}. Status is {}. ", newAttributeDef.getName(), component.getName(), status); + result = Either.right(status); + } + if (result == null) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreAttributesFrom(false); + getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); + if (getUpdatedComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); + result = Either.right(status); + } + } + if (result == null) { + Optional newProperty = ((Resource) getUpdatedComponentRes.left().value()).getAttributes().stream().filter(p -> p.getName().equals(newAttributeDef.getName())).findAny(); + if (newProperty.isPresent()) { + result = Either.left(newProperty.get()); + } else { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently added property {} on the resource {}. Status is {}. ", newAttributeDef.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + return result; + } + + public Either updateInputOfComponent(Component component, InputDefinition newInputDefinition) { + + Either getUpdatedComponentRes = null; + Either result = null; + StorageOperationStatus status = getToscaElementOperation(component).updateToscaDataOfToscaElement(component.getUniqueId(), EdgeLabelEnum.INPUTS, VertexTypeEnum.INPUTS, newInputDefinition, JsonPresentationFields.NAME); + if (status != StorageOperationStatus.OK) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to update the input {} to the component {}. Status is {}. ", newInputDefinition.getName(), component.getName(), status); + result = Either.right(status); + } + if (result == null) { + ComponentParametersView filter = new ComponentParametersView(true); + filter.setIgnoreInputs(false); + getUpdatedComponentRes = getToscaElement(component.getUniqueId(), filter); + if (getUpdatedComponentRes.isRight()) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to get updated resource {}. Status is {}. ", component.getUniqueId(), getUpdatedComponentRes.right().value()); + result = Either.right(status); + } + } + if (result == null) { + Optional updatedInput = getUpdatedComponentRes.left().value().getInputs().stream().filter(p -> p.getName().equals(newInputDefinition.getName())).findAny(); + if (updatedInput.isPresent()) { + result = Either.left(updatedInput.get()); + } else { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to find recently updated inputs {} on the resource {}. Status is {}. ", newInputDefinition.getName(), component.getUniqueId(), StorageOperationStatus.NOT_FOUND); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + return result; + } + + /** + * method - ename the group instances after referenced container name renamed flow - VF rename -(triggers)-> Group rename + * + * @param containerComponent + * - container such as service + * @param componentInstance + * - context component + * @param componentInstanceId + * - id + * + * @return - successfull/failed status + **/ + public Either cleanAndAddGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, String componentInstanceId) { + String uniqueId = componentInstance.getUniqueId(); + StorageOperationStatus status = nodeTemplateOperation.deleteToscaDataDeepElementsBlockToToscaElement(containerComponent.getUniqueId(), EdgeLabelEnum.INST_GROUPS, VertexTypeEnum.INST_GROUPS, uniqueId); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to delete group instances for container {}. error {] ", componentInstanceId, status); + return Either.right(status); + } + if (componentInstance.getGroupInstances() != null) { + status = addGroupInstancesToComponentInstance(containerComponent, componentInstance, componentInstance.getGroupInstances()); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to add group instances for container {}. error {] ", componentInstanceId, status); + return Either.right(status); + } + } + return Either.left(status); + } + + public StorageOperationStatus addGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, List groups, Map> groupInstancesArtifacts) { + return nodeTemplateOperation.addGroupInstancesToComponentInstance(containerComponent, componentInstance, groups, groupInstancesArtifacts); + } + + public Either, StorageOperationStatus> updateGroupsOnComponent(Component component, ComponentTypeEnum componentType, List updatedGroups) { + return groupsOperation.updateGroups(component, componentType, updatedGroups); + } + + public Either, StorageOperationStatus> updateGroupInstancesOnComponent(Component component, ComponentTypeEnum componentType, String instanceId, List updatedGroupInstances) { + return groupsOperation.updateGroupInstances(component, componentType, instanceId, updatedGroupInstances); + } + + public StorageOperationStatus addGroupInstancesToComponentInstance(Component containerComponent, ComponentInstance componentInstance, List groupInstances) { + return nodeTemplateOperation.addGroupInstancesToComponentInstance(containerComponent, componentInstance, groupInstances); + } + + public StorageOperationStatus addDeploymentArtifactsToComponentInstance(Component containerComponent, ComponentInstance componentInstance, Map deploymentArtifacts) { + return nodeTemplateOperation.addDeploymentArtifactsToComponentInstance(containerComponent, componentInstance, deploymentArtifacts); + } + + public StorageOperationStatus updateComponentInstanceProperty(Component containerComponent, String componentInstanceId, ComponentInstanceProperty property) { + return nodeTemplateOperation.updateComponentInstanceProperty(containerComponent, componentInstanceId, property); + } + + public StorageOperationStatus updateComponentInstanceProperties(Component containerComponent, String componentInstanceId, List properties) { + return nodeTemplateOperation.updateComponentInstanceProperties(containerComponent, componentInstanceId, properties); + } + + + public StorageOperationStatus addComponentInstanceProperty(Component containerComponent, String componentInstanceId, ComponentInstanceProperty property) { + return nodeTemplateOperation.addComponentInstanceProperty(containerComponent, componentInstanceId, property); + } + + public StorageOperationStatus updateComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { + return nodeTemplateOperation.updateComponentInstanceInput(containerComponent, componentInstanceId, property); + } + + public StorageOperationStatus updateComponentInstanceInputs(Component containerComponent, String componentInstanceId, List instanceInputs) { + return nodeTemplateOperation.updateComponentInstanceInputs(containerComponent, componentInstanceId, instanceInputs); + } + + public StorageOperationStatus addComponentInstanceInput(Component containerComponent, String componentInstanceId, ComponentInstanceInput property) { + return nodeTemplateOperation.addComponentInstanceInput(containerComponent, componentInstanceId, property); + } + + public void setNodeTypeOperation(NodeTypeOperation nodeTypeOperation) { + this.nodeTypeOperation = nodeTypeOperation; + } + + public void setTopologyTemplateOperation(TopologyTemplateOperation topologyTemplateOperation) { + this.topologyTemplateOperation = topologyTemplateOperation; + } public StorageOperationStatus deleteComponentInstanceInputsFromTopologyTemplate(Component containerComponent, ComponentTypeEnum componentType, List inputsToDelete) { return topologyTemplateOperation.deleteToscaDataElements(containerComponent.getUniqueId(), EdgeLabelEnum.INPUTS, inputsToDelete.stream().map(i -> i.getName()).collect(Collectors.toList())); } - + + public StorageOperationStatus updateComponentInstanceCapabiltyProperty(Component containerComponent, String componentInstanceUniqueId, String capabilityUniqueId, ComponentInstanceProperty property) { + return nodeTemplateOperation.updateComponentInstanceCapabilityProperty(containerComponent, componentInstanceUniqueId, capabilityUniqueId, property); + } + public StorageOperationStatus deleteAllCalculatedCapabilitiesRequirements(String topologyTemplateId) { StorageOperationStatus status = topologyTemplateOperation.removeToscaData(topologyTemplateId, EdgeLabelEnum.CALCULATED_CAPABILITIES, VertexTypeEnum.CALCULATED_CAPABILITIES); - if(status == StorageOperationStatus.OK){ + if (status == StorageOperationStatus.OK) { status = topologyTemplateOperation.removeToscaData(topologyTemplateId, EdgeLabelEnum.CALCULATED_REQUIREMENTS, VertexTypeEnum.CALCULATED_REQUIREMENTS); } + if(status == StorageOperationStatus.OK){ + status = topologyTemplateOperation.removeToscaData(topologyTemplateId, EdgeLabelEnum.CALCULATED_CAP_PROPERTIES, VertexTypeEnum.CALCULATED_CAP_PROPERTIES); + } return status; } @@ -2274,6 +2401,16 @@ public class ToscaOperationFacade { } return Either.left(clonedResource); } - + /** + * Returns list of ComponentInstanceProperty belonging to component instance capability specified by name and type + * @param componentId + * @param instanceId + * @param capabilityName + * @param capabilityType + * @return + */ + public Either, StorageOperationStatus> getComponentInstanceCapabilityProperties(String componentId, String instanceId, String capabilityName, String capabilityType) { + return topologyTemplateOperation.getComponentInstanceCapabilityProperties(componentId, instanceId, capabilityName, capabilityType); + } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java index 973b0ce069..e89f63b12f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/utils/ModelConverter.java @@ -35,13 +35,32 @@ import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; -import org.openecomp.sdc.be.datatypes.elements.*; +import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.CompositionDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.GroupInstanceDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapArtifactDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapCapabiltyProperty; +import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListCapabiltyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.AdditionalInformationDefinition; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; @@ -53,7 +72,7 @@ import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.InterfaceDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.RelationshipImpl; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; +import org.openecomp.sdc.be.model.RelationshipInfo; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.Resource; @@ -161,6 +180,7 @@ public class ModelConverter { service.setDistributionStatus(DistributionStatusEnum.findState((String) toscaElement.getMetadataValue(JsonPresentationFields.DISTRIBUTION_STATUS))); service.setEcompGeneratedNaming((Boolean) toscaElement.getMetadataValueOrDefault(JsonPresentationFields.ECOMP_GENERATED_NAMING, true)); service.setNamingPolicy((String) toscaElement.getMetadataValueOrDefault(JsonPresentationFields.NAMING_POLICY, StringUtils.EMPTY)); + service.setEnvironmentContext((String) toscaElement.getMetadataValue(JsonPresentationFields.ENVIRONMENT_CONTEXT)); } private static Resource convertToResource(ToscaElement toscaElement) { @@ -309,10 +329,8 @@ public class ModelConverter { RequirementCapabilityRelDef requirementCapabilityRelDef = new RequirementCapabilityRelDef(); requirementCapabilityRelDef.setFromNode(relation.getFromId()); requirementCapabilityRelDef.setToNode(relation.getToId()); - List relationships = new ArrayList<>(); - RequirementAndRelationshipPair relationshipPair = new RequirementAndRelationshipPair(); + RelationshipInfo relationshipPair = new RelationshipInfo(); relationshipPair.setId(relation.getUniqueId()); - relationshipPair.setCapabilityOwnerId(relation.getCapabilityOwnerId()); relationshipPair.setCapabilityUid(relation.getCapabilityId()); relationshipPair.setCapability(relation.getCapability()); @@ -322,8 +340,10 @@ public class ModelConverter { RelationshipImpl relationship = new RelationshipImpl(); relationship.setType(relation.getType()); relationshipPair.setRelationships(relationship); - - relationships.add(relationshipPair); + CapabilityRequirementRelationship rel = new CapabilityRequirementRelationship(); + rel.setRelation(relationshipPair); + List relationships = new ArrayList<>(); + relationships.add(rel); requirementCapabilityRelDef.setRelationships(relationships); return requirementCapabilityRelDef; } @@ -332,19 +352,19 @@ public class ModelConverter { List relationsList = new ArrayList<>(); - List relationship = relation.getRelationships(); + List relationship = relation.getRelationships(); relationship.forEach(p -> { RelationshipInstDataDefinition requirementCapabilityRelDef = new RelationshipInstDataDefinition(); requirementCapabilityRelDef.setFromId(relation.getFromNode()); requirementCapabilityRelDef.setToId(relation.getToNode()); - requirementCapabilityRelDef.setUniqueId(p.getId()); - requirementCapabilityRelDef.setCapabilityOwnerId(p.getCapabilityOwnerId()); - requirementCapabilityRelDef.setCapabilityId(p.getCapabilityUid()); - requirementCapabilityRelDef.setRequirementOwnerId(p.getRequirementOwnerId()); - requirementCapabilityRelDef.setRequirementId(p.getRequirementUid()); - requirementCapabilityRelDef.setRequirement(p.getRequirement()); - requirementCapabilityRelDef.setType(p.getRelationship().getType()); - requirementCapabilityRelDef.setCapability(p.getCapability()); + requirementCapabilityRelDef.setUniqueId(p.getRelation().getId()); + requirementCapabilityRelDef.setCapabilityOwnerId(p.getRelation().getCapabilityOwnerId()); + requirementCapabilityRelDef.setCapabilityId(p.getRelation().getCapabilityUid()); + requirementCapabilityRelDef.setRequirementOwnerId(p.getRelation().getRequirementOwnerId()); + requirementCapabilityRelDef.setRequirementId(p.getRelation().getRequirementUid()); + requirementCapabilityRelDef.setRequirement(p.getRelation().getRequirement()); + requirementCapabilityRelDef.setType(p.getRelation().getRelationship().getType()); + requirementCapabilityRelDef.setCapability(p.getRelation().getCapability()); relationsList.add(requirementCapabilityRelDef); }); @@ -408,7 +428,7 @@ public class ModelConverter { sb.append(cap.getOwnerId()); } sb.append(CAP_PROP_DELIM).append(s).append(CAP_PROP_DELIM).append(cap.getName()); - toscaCapPropMap.put(sb.toString(), dataToCreate); + toscaCapPropMap.put(sb.toString(), new MapPropertiesDataDefinition(dataToCreate)); } } @@ -455,54 +475,6 @@ public class ModelConverter { return new MapListRequirementDataDefinition(mapToscaDataDefinition); } - private static void convertRequirements(TopologyTemplate toscaElement, Component component) { - - if (CollectionUtils.isNotEmpty(component.getComponentInstances())) { - for (ComponentInstance instance : component.getComponentInstances()) { - Map> instanceRequirements = instance.getRequirements(); - if (MapUtils.isNotEmpty(instanceRequirements)) { - addRequirementsByInstanceId(instance.getUniqueId(), instanceRequirements, component); - } - } - } - } - - private static void addRequirementsByInstanceId(String instanceId, Map> instanceRequirementsMap, Component component) { - - if (component.getCapabilities() == null) { - component.setCapabilities(new HashMap<>()); - } - List instanceRequirements = new ArrayList<>(); - for (List instRequirements : instanceRequirementsMap.values()) { - instanceRequirements.addAll(instRequirements); - } - component.getRequirements().put(instanceId, instanceRequirements); - } - - private static void convertCapabilities(TopologyTemplate toscaElement, Component component) { - - if (CollectionUtils.isNotEmpty(component.getComponentInstances())) { - for (ComponentInstance instance : component.getComponentInstances()) { - Map> instanceCapabilities = instance.getCapabilities(); - if (MapUtils.isNotEmpty(instanceCapabilities)) { - addCapabilitiesByInstanceId(instance.getUniqueId(), instanceCapabilities, component); - } - } - } - } - - private static void addCapabilitiesByInstanceId(String instanceId, Map> instanceCapabilitiesMap, Component component) { - - if (component.getCapabilities() == null) { - component.setCapabilities(new HashMap<>()); - } - List instanceCapabilities = new ArrayList<>(); - for (List instCapabilitis : instanceCapabilitiesMap.values()) { - instanceCapabilities.addAll(instCapabilitis); - } - component.getCapabilities().put(instanceId, instanceCapabilities); - } - @SuppressWarnings("unchecked") private static void convertComponentFields(Component component, ToscaElement toscaElement) { component.setName(toscaElement.getName()); @@ -909,6 +881,7 @@ public class ModelConverter { topologyTemplate.setMetadataValue(JsonPresentationFields.PROJECT_CODE, service.getProjectCode()); topologyTemplate.setMetadataValue(JsonPresentationFields.ECOMP_GENERATED_NAMING, service.isEcompGeneratedNaming()); topologyTemplate.setMetadataValue(JsonPresentationFields.NAMING_POLICY, service.getNamingPolicy()); + topologyTemplate.setMetadataValue(JsonPresentationFields.ENVIRONMENT_CONTEXT, service.getEnvironmentContext()); } @@ -1125,10 +1098,15 @@ public class ModelConverter { } else { instancesCapabilities.put(capabilityType, caps); } - if (MapUtils.isEmpty(instancesMap.get(instanceId).getCapabilities())) { - instancesMap.get(instanceId).setCapabilities(new HashMap<>()); + ComponentInstance instance = instancesMap.get(instanceId); + if (instance == null) { + log.error("instance is null for id {} entry {}", instanceId, entry.getValue().getToscaPresentationValue(JsonPresentationFields.NAME)); + } else { + if (MapUtils.isEmpty(instance.getCapabilities())) { + instance.setCapabilities(new HashMap<>()); + } + instance.getCapabilities().put(capabilityType, new ArrayList<>(caps)); } - instancesMap.get(instanceId).getCapabilities().put(capabilityType, new ArrayList<>(caps)); } } component.setCapabilities(instancesCapabilities); @@ -1303,11 +1281,6 @@ public class ModelConverter { if (MapUtils.isNotEmpty(groups)) { groupDefinitions = groups.values().stream().map(g -> new GroupDefinition(g)).collect(Collectors.toList()); } - /* - * if (CollectionUtils.isNotEmpty(groupDefinitions) && MapUtils.isNotEmpty(groupsProperties)) { for (GroupDefinition groupDefinition : groupDefinitions) { if (groupsProperties.containsKey(groupDefinition.getName())) { Map properties = groupsProperties.get(groupDefinition.getName()).getMapToscaDataDefinition(); if (MapUtils.isNotEmpty(properties)) { groupDefinition.setProperties(properties.values().stream().map(p -> new - * GroupProperty(p)).collect(Collectors.toList())); } } } } - */ return groupDefinitions; } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IAdditionalInformationOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IAdditionalInformationOperation.java index eb6492fa84..9036c6275a 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IAdditionalInformationOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IAdditionalInformationOperation.java @@ -28,7 +28,6 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.AdditionalInformationDefinition; import org.openecomp.sdc.be.resources.data.AdditionalInfoParameterData; -import com.thinkaurelius.titan.core.TitanTransaction; import com.thinkaurelius.titan.core.TitanVertex; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IArtifactOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IArtifactOperation.java index 3d689a4f93..5393dbed6c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IArtifactOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IArtifactOperation.java @@ -22,12 +22,8 @@ package org.openecomp.sdc.be.model.operations.api; import java.util.Map; -import org.openecomp.sdc.be.dao.titan.TitanGenericDao; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.resources.data.ArtifactData; import com.thinkaurelius.titan.core.TitanVertex; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICacheMangerOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICacheMangerOperation.java index 52586dad60..6b5a143be3 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICacheMangerOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICacheMangerOperation.java @@ -21,9 +21,6 @@ package org.openecomp.sdc.be.model.operations.api; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.cache.jobs.CheckAndUpdateJob; -import org.openecomp.sdc.be.model.cache.jobs.StoreJob; /** * Created by mlando on 9/5/2016. diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICapabilityOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICapabilityOperation.java index b90f31f731..96c0e7e5db 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICapabilityOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/ICapabilityOperation.java @@ -23,16 +23,8 @@ package org.openecomp.sdc.be.model.operations.api; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.resources.data.CapabilityData; -import org.openecomp.sdc.be.resources.data.CapabilityTypeData; -import org.openecomp.sdc.be.resources.data.PropertyData; - -import com.thinkaurelius.titan.core.TitanVertex; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IComponentInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IComponentInstanceOperation.java index d1a1b6ac7b..90e01c3980 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IComponentInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IComponentInstanceOperation.java @@ -20,26 +20,12 @@ package org.openecomp.sdc.be.model.operations.api; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.RequirementAndRelationshipPair; -import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; -import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.be.resources.data.AttributeValueData; -import org.openecomp.sdc.be.resources.data.CapabilityData; import org.openecomp.sdc.be.resources.data.ComponentInstanceData; -import org.openecomp.sdc.be.resources.data.RequirementData; -import org.openecomp.sdc.exception.ResponseFormat; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IConsumerOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IConsumerOperation.java index cab49fe47d..c9e6d69cc3 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IConsumerOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IConsumerOperation.java @@ -20,12 +20,12 @@ package org.openecomp.sdc.be.model.operations.api; +import java.util.List; + import org.openecomp.sdc.be.resources.data.ConsumerData; import fj.data.Either; -import java.util.List; - public interface IConsumerOperation { /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupInstanceOperation.java index b55eff6684..6fe56d04b1 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupInstanceOperation.java @@ -21,25 +21,12 @@ package org.openecomp.sdc.be.model.operations.api; -import java.util.ArrayList; import java.util.List; -import java.util.Map; -import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; - -import org.openecomp.sdc.be.model.ComponentInstance; - import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupInstance; -import org.openecomp.sdc.be.model.GroupInstanceProperty; import org.openecomp.sdc.be.resources.data.ArtifactData; -import org.openecomp.sdc.exception.ResponseFormat; - -import com.thinkaurelius.titan.core.TitanVertex; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupOperation.java index 6dbbfb6b6e..0695346c5c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IGroupOperation.java @@ -25,10 +25,8 @@ import java.util.List; import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.resources.data.ArtifactData; -import org.openecomp.sdc.be.resources.data.GroupData; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInputsOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInputsOperation.java index 1cec537e3e..54405cf86c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInputsOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInputsOperation.java @@ -20,16 +20,10 @@ package org.openecomp.sdc.be.model.operations.api; -import fj.data.Either; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.ComponentInstanceInput; -import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.resources.data.InputValueData; -import org.openecomp.sdc.be.resources.data.InputsData; - -import java.util.List; public interface IInputsOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInterfaceLifecycleOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInterfaceLifecycleOperation.java index c9a332f069..ca29ab0f6e 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInterfaceLifecycleOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IInterfaceLifecycleOperation.java @@ -22,13 +22,10 @@ package org.openecomp.sdc.be.model.operations.api; import java.util.Map; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; import org.openecomp.sdc.be.model.InterfaceDefinition; import org.openecomp.sdc.be.model.Operation; -import com.thinkaurelius.titan.core.TitanVertex; - import fj.data.Either; public interface IInterfaceLifecycleOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IUserAdminOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IUserAdminOperation.java index 3df954fc36..6f33643db5 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IUserAdminOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IUserAdminOperation.java @@ -23,11 +23,8 @@ package org.openecomp.sdc.be.model.operations.api; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Edge; import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.model.FunctionalMenuInfo; import org.openecomp.sdc.be.model.User; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperation.java index d9fe1eea92..9ef116d0c9 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperation.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.operations.impl; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java index cadcd32926..d677a7e257 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CacheMangerOperation.java @@ -20,14 +20,28 @@ package org.openecomp.sdc.be.model.operations.impl; -import com.google.common.util.concurrent.ThreadFactoryBuilder; +import java.util.LinkedList; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; import org.openecomp.sdc.be.config.Configuration; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.cache.*; -import org.openecomp.sdc.be.model.cache.jobs.*; +import org.openecomp.sdc.be.model.cache.ComponentCache; +import org.openecomp.sdc.be.model.cache.DaoInfo; +import org.openecomp.sdc.be.model.cache.jobs.CheckAndUpdateJob; +import org.openecomp.sdc.be.model.cache.jobs.DeleteJob; +import org.openecomp.sdc.be.model.cache.jobs.Job; +import org.openecomp.sdc.be.model.cache.jobs.OverrideJob; +import org.openecomp.sdc.be.model.cache.jobs.StoreJob; import org.openecomp.sdc.be.model.cache.workers.CacheWorker; import org.openecomp.sdc.be.model.cache.workers.IWorker; import org.openecomp.sdc.be.model.cache.workers.SyncWorker; @@ -39,10 +53,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import java.util.LinkedList; -import java.util.concurrent.*; +import com.google.common.util.concurrent.ThreadFactoryBuilder; /** * Created by mlando on 9/5/2016. the class is responsible for handling all cache update operations asynchronously including sync between the graph and cache and on demand update requests diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityOperation.java index a4be274781..175c695e73 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CapabilityOperation.java @@ -20,49 +20,26 @@ package org.openecomp.sdc.be.model.operations.impl; -import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Set; import java.util.stream.Collectors; -import org.antlr.misc.Graph; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; -import org.openecomp.sdc.be.dao.graph.GraphElementFactory; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; -import org.openecomp.sdc.be.dao.graph.datatype.GraphElementTypeEnum; -import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; -import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; -import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.CapabilityDefinition; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.operations.api.ICapabilityOperation; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.resources.data.CapabilityData; import org.openecomp.sdc.be.resources.data.CapabilityTypeData; -import org.openecomp.sdc.be.resources.data.PropertyData; -import org.openecomp.sdc.be.resources.data.ResourceMetadataData; -import org.openecomp.sdc.be.resources.data.UniqueIdData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.databind.annotation.JsonAppend.Prop; -import com.thinkaurelius.titan.core.TitanVertex; - import fj.data.Either; @Component("capability-operation") diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ComponentInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ComponentInstanceOperation.java index 1ef64aed98..e67f9a4866 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ComponentInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ComponentInstanceOperation.java @@ -20,9 +20,11 @@ package org.openecomp.sdc.be.model.operations.impl; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; -import fj.data.Either; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.function.Supplier; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; @@ -59,10 +61,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.function.Supplier; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; + +import fj.data.Either; @org.springframework.stereotype.Component("component-instance-operation") public class ComponentInstanceOperation extends AbstractOperation implements IComponentInstanceOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ConsumerOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ConsumerOperation.java index a5a1348f21..198ad99ecb 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ConsumerOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ConsumerOperation.java @@ -20,6 +20,9 @@ package org.openecomp.sdc.be.model.operations.impl; +import java.util.Collections; +import java.util.List; + import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; @@ -34,9 +37,6 @@ import org.springframework.stereotype.Component; import fj.data.Either; -import java.util.Collections; -import java.util.List; - @Component("consumer-operation") public class ConsumerOperation implements IConsumerOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CsarOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CsarOperation.java index 815eb5be0e..88edb1fd9e 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CsarOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/CsarOperation.java @@ -35,6 +35,11 @@ import org.openecomp.sdc.common.util.ZipUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + import fj.data.Either; @org.springframework.stereotype.Component("csar-operation") @@ -105,6 +110,41 @@ public class CsarOperation { return result; } + + @SuppressWarnings("unchecked") + public Either getCsarLatestVersion(String csarUuid, User user) { + + Either result = onboardingClient.getPackages(user.getUserId()); + + if (result.isRight()) { + log.debug("Cannot find version for package with Id {}. Status returned is {}", csarUuid, result.right().value()); + } else { + String latestVersion = null; + JsonElement root = new JsonParser().parse(result.left().value()); + JsonArray csarsInfo = root.getAsJsonObject().get("results").getAsJsonArray(); + for (JsonElement csarInfo : csarsInfo) { + Map csarInfoMap = new Gson().fromJson(csarInfo, Map.class); + if(csarInfoMap.get("packageId").equals(csarUuid)){ + String curVersion = csarInfoMap.get("version"); + if(latestVersion == null || isGreater(latestVersion, curVersion)){ + latestVersion = curVersion; + } + } + } + if (latestVersion != null) { + result = Either.left(latestVersion); + } else { + log.debug("The returned packages are {}. Failed to find latest version for package with Id {}. ", result.left().value(), csarUuid); + result = Either.right(StorageOperationStatus.NOT_FOUND); + } + } + + return result; + } + + private boolean isGreater(String latestVersion, String currentVersion) { + return Double.parseDouble(latestVersion) < Double.parseDouble(currentVersion); + } public OnboardingClient getOnboardingClient() { return onboardingClient; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java index ea42c6d76b..41f6ce9d00 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java @@ -28,8 +28,8 @@ import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java index 4ffea48dee..c4a5c5c586 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java @@ -20,14 +20,17 @@ package org.openecomp.sdc.be.model.operations.impl; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; -import fj.data.Either; -import org.apache.commons.collections.CollectionUtils; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Supplier; +import java.util.stream.Collectors; + import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.openecomp.sdc.be.config.BeEcompErrorManager; @@ -65,14 +68,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.function.Supplier; -import java.util.stream.Collectors; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; + +import fj.data.Either; @org.springframework.stereotype.Component("group-instance-operation") public class GroupInstanceOperation extends AbstractOperation implements IGroupInstanceOperation { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupOperation.java index 02c5194da3..77e7ba1f2d 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupOperation.java @@ -24,44 +24,31 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; import java.util.stream.Collectors; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.model.GroupTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.operations.api.IGroupOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.resources.data.ArtifactData; import org.openecomp.sdc.be.resources.data.ComponentInstanceData; -import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.openecomp.sdc.be.resources.data.GroupData; import org.openecomp.sdc.be.resources.data.GroupTypeData; import org.openecomp.sdc.be.resources.data.PropertyData; import org.openecomp.sdc.be.resources.data.PropertyValueData; -import org.openecomp.sdc.be.resources.data.ResourceMetadataData; -import org.openecomp.sdc.be.resources.data.ServiceMetadataData; import org.openecomp.sdc.be.resources.data.UniqueIdData; -import org.openecomp.sdc.common.datastructure.Wrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperation.java index ad56779a94..0a150ae7c3 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperation.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.thinkaurelius.titan.core.TitanTransaction; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Edge; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; @@ -36,7 +35,6 @@ import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.HeatParameterDefinition; -import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.heat.HeatParameterType; import org.openecomp.sdc.be.model.operations.api.IHeatParametersOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InputsOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InputsOperation.java index 782c78715f..287a63ea3a 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InputsOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InputsOperation.java @@ -21,69 +21,31 @@ package org.openecomp.sdc.be.model.operations.impl; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import javax.json.Json; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.tinkerpop.gremlin.process.traversal.Order; -import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.json.simple.JSONObject; -import org.json.simple.parser.ParseException; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; -import org.openecomp.sdc.be.dao.graph.GraphElementFactory; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; -import org.openecomp.sdc.be.dao.graph.datatype.GraphElementTypeEnum; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; -import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; import org.openecomp.sdc.be.dao.neo4j.GraphEdgePropertiesDictionary; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; - import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.ComponentInstInputsMap; -import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; -import org.openecomp.sdc.be.model.ComponentInstancePropInput; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.InputDefinition; -import org.openecomp.sdc.be.model.PropertyConstraint; -import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.operations.api.IInputsOperation; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.resources.data.AttributeData; import org.openecomp.sdc.be.resources.data.ComponentInstanceData; -import org.openecomp.sdc.be.resources.data.ComponentMetadataData; import org.openecomp.sdc.be.resources.data.InputValueData; import org.openecomp.sdc.be.resources.data.InputsData; import org.openecomp.sdc.be.resources.data.PropertyData; -import org.openecomp.sdc.be.resources.data.PropertyValueData; import org.openecomp.sdc.be.resources.data.ResourceMetadataData; -import org.openecomp.sdc.be.resources.data.UniqueIdData; -import org.openecomp.sdc.common.datastructure.Wrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.yaml.snakeyaml.Yaml; import com.google.gson.Gson; -import com.thinkaurelius.titan.core.TitanEdge; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; -import com.thinkaurelius.titan.core.TitanVertexQuery; -import com.thinkaurelius.titan.core.attribute.Cmp; import fj.data.Either; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperation.java index 1c03d579a0..b78ad02452 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperation.java @@ -29,7 +29,6 @@ import java.util.Set; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OnboardingClient.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OnboardingClient.java index 033d5c268b..9b6591ec08 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OnboardingClient.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OnboardingClient.java @@ -32,13 +32,14 @@ import javax.annotation.PostConstruct; import org.apache.commons.io.filefilter.WildcardFileFilter; import org.apache.http.HttpStatus; import org.openecomp.sdc.be.config.BeEcompErrorManager; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; import org.openecomp.sdc.be.config.Configuration.OnboardingConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.rest.HttpRestClient; import org.openecomp.sdc.be.dao.rest.RestConfigurationInfo; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.rest.api.RestResponse; import org.openecomp.sdc.common.rest.api.RestResponseAsByteArray; import org.openecomp.sdc.common.util.ZipUtil; import org.slf4j.Logger; @@ -156,6 +157,41 @@ public class OnboardingClient { } } + + public Either getPackages(String userId) { + + if (httpRestClient == null) { + BeEcompErrorManager.getInstance().logInternalFlowError("RestClient", "Rest Client could not be initialized", ErrorSeverity.ERROR); + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + + String url = buildDownloadCsarUrl(); + + Properties headers = new Properties(); + headers.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"); + + if (userId != null) { + headers.put(Constants.USER_ID_HEADER, userId); + } + + log.debug("Url for downloading packages is {}. Headers are {}", url, headers); + + RestResponse restResponse = httpRestClient.doGET(url, headers); + log.debug("After fetching packages. Http return code is {}", restResponse.getHttpStatusCode()); + + switch (restResponse.getHttpStatusCode()) { + case HttpStatus.SC_OK: + String data = restResponse.getResponse(); + return Either.left(data); + + case HttpStatus.SC_NOT_FOUND: + return Either.right(StorageOperationStatus.CSAR_NOT_FOUND); + + default: + return Either.right(StorageOperationStatus.GENERAL_ERROR); + } + + } public HttpRestClient getHttpRestClient() { return httpRestClient; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperation.java index 62ab886472..9aa231497d 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperation.java @@ -20,9 +20,12 @@ package org.openecomp.sdc.be.model.operations.impl; -import com.thinkaurelius.titan.core.TitanVertex; -import fj.data.Either; -import org.apache.commons.lang3.tuple.ImmutablePair; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -35,12 +38,10 @@ import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.dao.utils.UserStatusEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; -import org.openecomp.sdc.be.model.FunctionalMenuInfo; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.operations.api.IUserAdminOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.resources.data.UserData; -import org.openecomp.sdc.be.resources.data.UserFunctionalMenuData; import org.openecomp.sdc.common.datastructure.Wrapper; import org.openecomp.sdc.common.util.MethodActivationStatusEnum; import org.slf4j.Logger; @@ -48,11 +49,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import com.thinkaurelius.titan.core.TitanVertex; + +import fj.data.Either; @Component("user-operation") public class UserAdminOperation implements IUserAdminOperation { @@ -98,7 +97,7 @@ public class UserAdminOperation implements IUserAdminOperation { return resultWrapper.getInnerElement(); } finally { - if (false == inTransaction) { + if (!inTransaction) { titanGenericDao.commit(); } log.debug("getUserData - end"); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/utils/ComponentValidationUtils.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/utils/ComponentValidationUtils.java index 01c9eefb20..2c2d3e7598 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/utils/ComponentValidationUtils.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/utils/ComponentValidationUtils.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.operations.utils; -import fj.data.Either; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.LifecycleStateEnum; @@ -30,6 +29,8 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import fj.data.Either; + public class ComponentValidationUtils { private static Logger log = LoggerFactory.getLogger(ComponentValidationUtils.class.getName()); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintFunctionalException.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintFunctionalException.java index 3fd165f41e..c4237e9bcb 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintFunctionalException.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintFunctionalException.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.tosca.constraints.exception; -import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil; import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil.ConstraintInformation; /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintRequiredParameterException.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintRequiredParameterException.java index 2416405de4..338e4aa51a 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintRequiredParameterException.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintRequiredParameterException.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.tosca.constraints.exception; -import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil; import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil.ConstraintInformation; /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintValueDoNotMatchPropertyTypeException.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintValueDoNotMatchPropertyTypeException.java index 6ba0d9b864..10d4e44fe2 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintValueDoNotMatchPropertyTypeException.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintValueDoNotMatchPropertyTypeException.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.tosca.constraints.exception; -import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil; import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil.ConstraintInformation; /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintViolationException.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintViolationException.java index 7fce63841d..29db0aa1af 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintViolationException.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/exception/ConstraintViolationException.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.be.model.tosca.constraints.exception; -import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil; import org.openecomp.sdc.be.model.tosca.constraints.ConstraintUtil.ConstraintInformation; /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverter.java index f3b842e0cf..32929beb5f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverter.java @@ -1,18 +1,19 @@ package org.openecomp.sdc.be.model.tosca.converters; +import java.io.StringReader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; +import org.openecomp.sdc.common.util.JsonUtils; + import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; -import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.common.util.JsonUtils; - -import java.io.StringReader; -import java.util.HashMap; -import java.util.List; -import java.util.Map; public class DataTypePropertyConverter { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverter.java index 3879430e06..3472b6448c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverter.java @@ -28,7 +28,6 @@ import org.openecomp.sdc.common.util.GsonFactory; import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonReader; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaConverterUtils.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaConverterUtils.java index 159addcbc9..4aadaa0910 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaConverterUtils.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaConverterUtils.java @@ -1,9 +1,9 @@ package org.openecomp.sdc.be.model.tosca.converters; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import org.openecomp.sdc.be.model.tosca.ToscaFunctions; +import com.google.gson.JsonObject; + public class ToscaConverterUtils { public static boolean isGetInputValue(JsonObject value) { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/DataTypeValidatorConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/DataTypeValidatorConverter.java index 3240ccc679..1466980156 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/DataTypeValidatorConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/DataTypeValidatorConverter.java @@ -29,7 +29,6 @@ import java.util.Set; import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.PropertyOperation; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; import org.openecomp.sdc.be.model.tosca.converters.PropertyValueConverter; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/JsonValidator.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/JsonValidator.java index 164fe62792..6a1aff558f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/JsonValidator.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/JsonValidator.java @@ -23,17 +23,10 @@ package org.openecomp.sdc.be.model.tosca.validators; import java.io.StringReader; import java.util.Map; -import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; -import org.openecomp.sdc.common.util.GsonFactory; -import org.openecomp.sdc.common.util.JsonUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import com.google.gson.stream.JsonReader; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/StringValidator.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/StringValidator.java index a096990ad7..dad3461c91 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/StringValidator.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/StringValidator.java @@ -22,8 +22,8 @@ package org.openecomp.sdc.be.model.tosca.validators; import java.util.Map; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.Configuration.ToscaValidatorsConfig; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.common.util.ValidationUtils; import org.slf4j.Logger; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransfer.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransfer.java index 6ebb32e7f5..d699f28d07 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransfer.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransfer.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; import java.util.Map; -import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.AdditionalInformationDefinition; import org.openecomp.sdc.be.model.ArtifactDefinition; @@ -33,8 +32,6 @@ import org.openecomp.sdc.be.model.ComponentInstanceInput; import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.InputDefinition; -import org.openecomp.sdc.be.model.InterfaceDefinition; -import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; import org.openecomp.sdc.be.model.RequirementDefinition; import org.openecomp.sdc.be.model.category.CategoryDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentMetadata.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentMetadata.java index dfc4c8c994..0719655704 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentMetadata.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiComponentMetadata.java @@ -25,7 +25,6 @@ import java.util.Map; import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.category.CategoryDefinition; public abstract class UiComponentMetadata { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiResourceMetadata.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiResourceMetadata.java index 68abb4d749..0923acb6d1 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiResourceMetadata.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiResourceMetadata.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; + import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.category.CategoryDefinition; diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java index 9a79a26881..3ab45f2d0e 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java @@ -32,6 +32,7 @@ public class UiServiceMetadata extends UiComponentMetadata { private String namingPolicy; private String serviceType; private String serviceRole; + private String environmentContext; public UiServiceMetadata(List categories, ServiceMetadataDataDefinition metadata) { super(categories, metadata); @@ -40,6 +41,7 @@ public class UiServiceMetadata extends UiComponentMetadata { this.namingPolicy = metadata.getNamingPolicy(); this.serviceType = metadata.getServiceType(); this.serviceRole = metadata.getServiceRole(); + this.environmentContext = metadata.getEnvironmentContext(); } public String getDistributionStatus() { @@ -82,4 +84,7 @@ public class UiServiceMetadata extends UiComponentMetadata { this.serviceRole = serviceRole; } + public String getEnvironmentContext() { return environmentContext; } + + public void setEnvironmentContext(String environmentContext) { this.environmentContext = environmentContext; } } diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/AdditionalInformationDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/AdditionalInformationDefinitionTest.java index 67e5280f53..f7ebf75b3c 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/AdditionalInformationDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/AdditionalInformationDefinitionTest.java @@ -1,10 +1,6 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; -import java.util.*; -import org.junit.Assert; public class AdditionalInformationDefinitionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactDefinitionTest.java index ae347cabc3..49e35363d6 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactUiDownloadDataTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactUiDownloadDataTest.java index 6df1079f4a..dc801581b9 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactUiDownloadDataTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ArtifactUiDownloadDataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; public class ArtifactUiDownloadDataTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapReqDefTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapReqDefTest.java index d0c121fa5f..7714d43c68 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapReqDefTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapReqDefTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityDefinitionTest.java index 007a64a75d..d1c734383d 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityDefinitionTest.java @@ -2,11 +2,7 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import java.util.*; -import org.junit.Assert; public class CapabilityDefinitionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityTypeDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityTypeDefinitionTest.java index 75cc2054e5..f05a302fdb 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityTypeDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CapabilityTypeDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstInputsMapTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstInputsMapTest.java index af9f683193..90eb99504f 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstInputsMapTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstInputsMapTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; public class ComponentInstInputsMapTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstanceInputTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstanceInputTest.java index 07eea5584c..56e34678f9 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstanceInputTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstanceInputTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyRule; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropInputTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropInputTest.java index 69b3f25f5e..2d53b31905 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropInputTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropInputTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropertyTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropertyTest.java index 4718847559..b888e95d64 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropertyTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentInstancePropertyTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.PropertyRule; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentMetadataDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentMetadataDefinitionTest.java index f728aac968..1642f517c2 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentMetadataDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentMetadataDefinitionTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CsarInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CsarInfoTest.java index 31864c479c..d7444e3602 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/CsarInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/CsarInfoTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.model; import java.util.Map; import java.util.Queue; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/DataTypeDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/DataTypeDefinitionTest.java index 996e3a7bd8..7cd50ce418 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/DataTypeDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/DataTypeDefinitionTest.java @@ -2,11 +2,7 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import java.util.*; -import org.junit.Assert; public class DataTypeDefinitionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/FunctionalMenuInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/FunctionalMenuInfoTest.java index 3df5b58955..ca5d1a2ec8 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/FunctionalMenuInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/FunctionalMenuInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupDefinitionTest.java index 6cae685644..db97b1e809 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupPropertyTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupPropertyTest.java index 6f8f53b991..ffec81e6ea 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupPropertyTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupPropertyTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupTypeDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupTypeDefinitionTest.java index 63f9e624cb..f84ec7c750 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupTypeDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupTypeDefinitionTest.java @@ -2,11 +2,7 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import java.util.*; -import org.junit.Assert; public class GroupTypeDefinitionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InputDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InputDefinitionTest.java index 68ff7ed6d3..65732607d1 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InputDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InputDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java index 88c253360c..3f5b218097 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/InterfaceDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/NodeTypeInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/NodeTypeInfoTest.java index 9a95a879df..d6d39ae825 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/NodeTypeInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/NodeTypeInfoTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PointTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PointTest.java index 8f25cfd5e4..f528375b33 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PointTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PointTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PolicyTypeDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PolicyTypeDefinitionTest.java index 3ba8f61826..2ff19c3969 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PolicyTypeDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PolicyTypeDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ProductTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ProductTest.java index 64ee3db41b..23f1ca48b3 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ProductTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ProductTest.java @@ -2,10 +2,7 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.datatypes.elements.ProductMetadataDataDefinition; public class ProductTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PropertyDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PropertyDefinitionTest.java index 81df0e223d..639be3a5d7 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/PropertyDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/PropertyDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPairTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPairTest.java deleted file mode 100644 index bc03848b9c..0000000000 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementAndRelationshipPairTest.java +++ /dev/null @@ -1,216 +0,0 @@ -package org.openecomp.sdc.be.model; - -import javax.annotation.Generated; - -import org.junit.Assert; -import org.junit.Test; -import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition; - - -public class RequirementAndRelationshipPairTest { - - private RequirementAndRelationshipPair createTestSubject() { - return new RequirementAndRelationshipPair(); - } - - - @Test - public void testGetRequirement() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getRequirement(); - } - - - @Test - public void testSetRequirement() throws Exception { - RequirementAndRelationshipPair testSubject; - String requirement = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setRequirement(requirement); - } - - - @Test - public void testGetCapabilityOwnerId() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCapabilityOwnerId(); - } - - - @Test - public void testSetCapabilityOwnerId() throws Exception { - RequirementAndRelationshipPair testSubject; - String capabilityOwnerId = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setCapabilityOwnerId(capabilityOwnerId); - } - - - @Test - public void testGetRequirementOwnerId() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getRequirementOwnerId(); - } - - - @Test - public void testSetRequirementOwnerId() throws Exception { - RequirementAndRelationshipPair testSubject; - String requirementOwnerId = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setRequirementOwnerId(requirementOwnerId); - } - - - @Test - public void testGetRelationship() throws Exception { - RequirementAndRelationshipPair testSubject; - RelationshipImpl result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getRelationship(); - } - - - @Test - public void testSetRelationships() throws Exception { - RequirementAndRelationshipPair testSubject; - RelationshipImpl relationship = null; - - // default test - testSubject = createTestSubject(); - testSubject.setRelationships(relationship); - } - - - @Test - public void testGetCapability() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCapability(); - } - - - @Test - public void testSetCapability() throws Exception { - RequirementAndRelationshipPair testSubject; - String capability = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setCapability(capability); - } - - - @Test - public void testGetCapabilityUid() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getCapabilityUid(); - } - - - @Test - public void testSetCapabilityUid() throws Exception { - RequirementAndRelationshipPair testSubject; - String capabilityUid = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setCapabilityUid(capabilityUid); - } - - - @Test - public void testGetRequirementUid() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getRequirementUid(); - } - - - @Test - public void testSetRequirementUid() throws Exception { - RequirementAndRelationshipPair testSubject; - String requirementUid = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setRequirementUid(requirementUid); - } - - - @Test - public void testGetId() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getId(); - } - - - @Test - public void testSetId() throws Exception { - RequirementAndRelationshipPair testSubject; - String id = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setId(id); - } - - - @Test - public void testToString() throws Exception { - RequirementAndRelationshipPair testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.toString(); - } - - - @Test - public void testEqualsTo() throws Exception { - RequirementAndRelationshipPair testSubject; - RelationshipInstDataDefinition savedRelation = null; - boolean result; - - // test 1 - testSubject = createTestSubject(); - savedRelation = null; - result = testSubject.equalsTo(savedRelation); - Assert.assertEquals(false, result); - } -} \ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementImplDefTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementImplDefTest.java index ea747b3a48..58bccbefda 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementImplDefTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementImplDefTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementInstanceTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementInstanceTest.java index 72f6ee2716..83472b0db5 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementInstanceTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/RequirementInstanceTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ResourceInstanceHeatParameterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ResourceInstanceHeatParameterTest.java index 50c423b847..95b314604a 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ResourceInstanceHeatParameterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ResourceInstanceHeatParameterTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadCapInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadCapInfoTest.java index 655df75cc4..92075ba128 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadCapInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadCapInfoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadPropInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadPropInfoTest.java index 0b3e9301cd..9cc0d1c3d9 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadPropInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadPropInfoTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadReqInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadReqInfoTest.java index eb1306c597..9aebec85fe 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadReqInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadReqInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/cache/DaoInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/cache/DaoInfoTest.java index 1428a86342..ba33ce9733 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/cache/DaoInfoTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/cache/DaoInfoTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.cache; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/CategoryDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/CategoryDefinitionTest.java index 3bb589a976..cac17ef798 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/CategoryDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/CategoryDefinitionTest.java @@ -2,11 +2,7 @@ package org.openecomp.sdc.be.model.category; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import java.util.*; -import org.junit.Assert; public class CategoryDefinitionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/SubCategoryDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/SubCategoryDefinitionTest.java index f9acabdc4b..4349ca24e3 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/SubCategoryDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/category/SubCategoryDefinitionTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.category; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/NodeTypeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/NodeTypeTest.java index ba7b253463..aae9d6f2a0 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/NodeTypeTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/NodeTypeTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.model.jsontitan.datamodel; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/TopologyTemplateTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/TopologyTemplateTest.java index bd5a16a844..0f1b91807d 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/TopologyTemplateTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/TopologyTemplateTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.jsontitan.datamodel; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition; import org.openecomp.sdc.be.datatypes.elements.ComponentInstanceDataDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/ToscaElementTypeEnumTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/ToscaElementTypeEnumTest.java index 671eeb2219..a112c9e51e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/ToscaElementTypeEnumTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/datamodel/ToscaElementTypeEnumTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.model.jsontitan.datamodel; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; public class ToscaElementTypeEnumTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/enums/JsonConstantKeysEnumTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/enums/JsonConstantKeysEnumTest.java index 11faa42b79..b00b13e162 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/enums/JsonConstantKeysEnumTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/enums/JsonConstantKeysEnumTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.jsontitan.enums; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperationsTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperationsTest.java index 3f80806292..a8fb60999c 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperationsTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperationsTest.java @@ -1,6 +1,18 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.CALLS_REAL_METHODS; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + import org.junit.Test; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; @@ -10,14 +22,7 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.*; +import fj.data.Either; public class ArtifactsOperationsTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperationTest.java new file mode 100644 index 0000000000..a1a257b893 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTemplateOperationTest.java @@ -0,0 +1,194 @@ +package org.openecomp.sdc.be.model.jsontitan.operations; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.mockito.Mockito; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListCapabiltyDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapListRequirementDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; +import org.openecomp.sdc.be.model.CapabilityRequirementRelationship; +import org.openecomp.sdc.be.model.ModelTestBase; +import org.openecomp.sdc.be.model.RelationshipImpl; +import org.openecomp.sdc.be.model.RelationshipInfo; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; + +import com.google.common.collect.Lists; + +import fj.data.Either; + +public class NodeTemplateOperationTest extends ModelTestBase{ + + private final static String COMPONENT_ID = "componentId"; + private final static String TO_INSTANCE_ID = "toInstanceId"; + private final static String FROM_INSTANCE_ID = "fromInstanceId"; + private final static String RELATION_ID = "relationId"; + private final static String CAPABILITY_OWNER_ID = "capabilityOwnerId"; + private final static String CAPABILITY_UID = "capabilityUid"; + private final static String CAPABILITY_NAME = "capabilityName"; + private final static String REQUIREMENT_OWNER_ID = "requirementOwnerId"; + private final static String REQUIREMENT_UID = "requirementUid"; + private final static String REQUIREMENT_NAME = "requirementName"; + private final static String RELATIONSHIP_TYPE = "relationshipType"; + + private static Map fulfilledCapability; + private static Map fulfilledRequirement; + private static CapabilityDataDefinition capability; + private static RequirementDataDefinition requirement; + private static RequirementCapabilityRelDef relation; + + private static TitanDao titanDao; + private static NodeTemplateOperation operation; + + @BeforeClass + public static void setup() { + init(); + titanDao = Mockito.mock(TitanDao.class); + operation = new NodeTemplateOperation(); + operation.setTitanDao(titanDao); + buildDataDefinition(); + } + + private static void buildDataDefinition() { + buildCapabiltyDataDefinition(); + buildRequirementDataDefinition(); + buildRelation(); + } + + @Test + public void testGetFulfilledCapabilityByRelationSuccess(){ + GraphVertex vertex = Mockito.mock(GraphVertex.class); + Either vertexRes = Either.left(vertex); + when(titanDao.getVertexById(eq(COMPONENT_ID), eq(JsonParseFlagEnum.ParseAll))).thenReturn(vertexRes); + + GraphVertex dataVertex = new GraphVertex(); + dataVertex.setJson(fulfilledCapability); + Either childVertexRes = Either.left(dataVertex); + when(titanDao.getChildVertex(eq(vertex), eq(EdgeLabelEnum.FULLFILLED_CAPABILITIES), eq(JsonParseFlagEnum.ParseJson))).thenReturn(childVertexRes); + Either result = operation.getFulfilledCapabilityByRelation(COMPONENT_ID, TO_INSTANCE_ID, relation, (rel, cap)->isBelongingCapability(rel, cap)); + assertTrue(result.isLeft()); + assertTrue(result.left().value().equals(capability)); + } + + @Test + public void testGetFulfilledRequirementByRelationSuccess(){ + GraphVertex vertex = Mockito.mock(GraphVertex.class); + Either vertexRes = Either.left(vertex); + when(titanDao.getVertexById(eq(COMPONENT_ID), eq(JsonParseFlagEnum.ParseAll))).thenReturn(vertexRes); + + GraphVertex dataVertex = new GraphVertex(); + dataVertex.setJson(fulfilledRequirement); + Either childVertexRes = Either.left(dataVertex); + when(titanDao.getChildVertex(eq(vertex), eq(EdgeLabelEnum.FULLFILLED_REQUIREMENTS), eq(JsonParseFlagEnum.ParseJson))).thenReturn(childVertexRes); + Either result = operation.getFulfilledRequirementByRelation(COMPONENT_ID, FROM_INSTANCE_ID, relation, (rel, req)->isBelongingRequirement(rel, req)); + assertTrue(result.isLeft()); + assertTrue(result.left().value().equals(requirement)); + } + + @Test + public void testGetFulfilledCapabilityByRelationNotFoundFailure(){ + GraphVertex vertex = Mockito.mock(GraphVertex.class); + Either vertexRes = Either.left(vertex); + when(titanDao.getVertexById(eq(COMPONENT_ID), eq(JsonParseFlagEnum.ParseAll))).thenReturn(vertexRes); + + Either childVertexRes = Either.right(TitanOperationStatus.NOT_FOUND); + when(titanDao.getChildVertex(eq(vertex), eq(EdgeLabelEnum.FULLFILLED_CAPABILITIES), eq(JsonParseFlagEnum.ParseJson))).thenReturn(childVertexRes); + Either result = operation.getFulfilledCapabilityByRelation(COMPONENT_ID, TO_INSTANCE_ID, relation, (rel, cap)->isBelongingCapability(rel, cap)); + assertTrue(result.isRight()); + assertTrue(result.right().value() == StorageOperationStatus.NOT_FOUND); + } + + @Test + public void testGetFulfilledRequirementByRelationNotFoundFailure(){ + GraphVertex vertex = Mockito.mock(GraphVertex.class); + Either vertexRes = Either.left(vertex); + when(titanDao.getVertexById(eq(COMPONENT_ID), eq(JsonParseFlagEnum.ParseAll))).thenReturn(vertexRes); + + Either childVertexRes = Either.right(TitanOperationStatus.NOT_FOUND); + when(titanDao.getChildVertex(eq(vertex), eq(EdgeLabelEnum.FULLFILLED_REQUIREMENTS), eq(JsonParseFlagEnum.ParseJson))).thenReturn(childVertexRes); + Either result = operation.getFulfilledRequirementByRelation(COMPONENT_ID, FROM_INSTANCE_ID, relation,(rel, req)->isBelongingRequirement(rel, req)); + assertTrue(result.isRight()); + assertTrue(result.right().value() == StorageOperationStatus.NOT_FOUND); + } + + private static void buildRequirementDataDefinition() { + buildRequirement(); + fulfilledRequirement = new HashMap<>(); + MapListRequirementDataDefinition mapListRequirementDataDefinition = new MapListRequirementDataDefinition(); + mapListRequirementDataDefinition.add(requirement.getCapability(), requirement); + fulfilledRequirement.put(FROM_INSTANCE_ID, mapListRequirementDataDefinition); + + } + + private static void buildRequirement() { + requirement = new RequirementDataDefinition(); + requirement.setOwnerId(REQUIREMENT_OWNER_ID); + requirement.setUniqueId(REQUIREMENT_UID); + requirement.setName(REQUIREMENT_NAME); + requirement.setRelationship(RELATIONSHIP_TYPE); + } + + private static void buildCapabiltyDataDefinition() { + buildCapability(); + fulfilledCapability = new HashMap<>(); + MapListCapabiltyDataDefinition mapListCapabiltyDataDefinition = new MapListCapabiltyDataDefinition(); + mapListCapabiltyDataDefinition.add(capability.getType(), capability); + fulfilledCapability.put(TO_INSTANCE_ID, mapListCapabiltyDataDefinition); + } + + private static void buildCapability() { + capability = new CapabilityDataDefinition(); + capability.setOwnerId(CAPABILITY_OWNER_ID); + capability.setUniqueId(CAPABILITY_UID); + capability.setName(CAPABILITY_NAME); + } + + private static void buildRelation() { + + relation = new RequirementCapabilityRelDef(); + CapabilityRequirementRelationship relationship = new CapabilityRequirementRelationship(); + RelationshipInfo relationInfo = new RelationshipInfo(); + relationInfo.setId(RELATION_ID); + relationship.setRelation(relationInfo); + + relation.setRelationships(Lists.newArrayList(relationship)); + relation.setToNode(TO_INSTANCE_ID); + relation.setFromNode(FROM_INSTANCE_ID); + + relationInfo.setCapabilityOwnerId(CAPABILITY_OWNER_ID); + relationInfo.setCapabilityUid(CAPABILITY_UID); + relationInfo.setCapability(CAPABILITY_NAME); + relationInfo.setRequirementOwnerId(REQUIREMENT_OWNER_ID); + relationInfo.setRequirementUid(REQUIREMENT_UID); + relationInfo.setRequirement(REQUIREMENT_NAME); + RelationshipImpl relationshipImpl = new RelationshipImpl(); + relationshipImpl.setType(RELATIONSHIP_TYPE); + relationInfo.setRelationships(relationshipImpl); + } + + private boolean isBelongingRequirement(RelationshipInfo relationshipInfo, RequirementDataDefinition req) { + return req.getRelationship().equals(relationshipInfo.getRelationship().getType()) && + req.getName().equals(relationshipInfo.getRequirement()) && + req.getUniqueId().equals(relationshipInfo.getRequirementUid()) && + req.getOwnerId().equals(relationshipInfo.getRequirementOwnerId()); + } + + private boolean isBelongingCapability(RelationshipInfo relationshipInfo, CapabilityDataDefinition cap) { + return cap.getName().equals(relationshipInfo.getCapability()) && + cap.getUniqueId().equals(relationshipInfo.getCapabilityUid()) && + cap.getOwnerId().equals(relationshipInfo.getCapabilityOwnerId()); + } +} diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTestImpl.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTestImpl.java index 27fbce4776..da3ae71399 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTestImpl.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTestImpl.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; @@ -9,6 +8,8 @@ import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import fj.data.Either; + /** * Created by cb478c on 6/13/2017. */ diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacadeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacadeTest.java index d2d26e79d5..4a7d27812d 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacadeTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacadeTest.java @@ -1,6 +1,15 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,15 +33,7 @@ import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; +import fj.data.Either; @RunWith(MockitoJUnitRunner.class) public class ToscaOperationFacadeTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/GraphTestUtils.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/GraphTestUtils.java index 8e2a283559..862515c58e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/GraphTestUtils.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/utils/GraphTestUtils.java @@ -20,9 +20,14 @@ package org.openecomp.sdc.be.model.jsontitan.utils; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; -import fj.data.Either; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.Map; +import java.util.UUID; + import org.apache.tinkerpop.gremlin.structure.io.IoCore; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; @@ -32,13 +37,10 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.util.Iterator; -import java.util.Map; -import java.util.UUID; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; + +import fj.data.Either; public final class GraphTestUtils { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/AdditionalInformationOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/AdditionalInformationOperationTest.java index b24d6d8285..f68da59681 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/AdditionalInformationOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/AdditionalInformationOperationTest.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.be.model.operations.impl; +import static org.junit.Assert.assertTrue; + import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -33,8 +35,6 @@ import org.openecomp.sdc.be.resources.data.UserData; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.assertTrue; - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:application-context-test.xml") public class AdditionalInformationOperationTest extends ModelTestBase { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperationTest.java index 1082b44e5b..95ae6ced49 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ArtifactOperationTest.java @@ -20,7 +20,16 @@ package org.openecomp.sdc.be.model.operations.impl; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; @@ -52,12 +61,7 @@ import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.*; +import fj.data.Either; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:application-context-test.xml") diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperationTest.java index f6f02457d5..47165133c6 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/CapabilityTypeOperationTest.java @@ -35,8 +35,6 @@ import javax.annotation.Resource; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; -import org.openecomp.sdc.be.config.Configuration; -import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.model.CapabilityTypeDefinition; @@ -44,13 +42,10 @@ import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.PropertyConstraint; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.model.operations.impl.CapabilityTypeOperation; import org.openecomp.sdc.be.model.tosca.ToscaType; import org.openecomp.sdc.be.model.tosca.constraints.GreaterThanConstraint; import org.openecomp.sdc.be.model.tosca.constraints.InRangeConstraint; import org.openecomp.sdc.be.model.tosca.constraints.LessOrEqualConstraint; -import org.openecomp.sdc.common.api.ConfigurationListener; -import org.openecomp.sdc.common.api.ConfigurationSource; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ElementOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ElementOperationTest.java index eb2615f19b..e03349d9ab 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ElementOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ElementOperationTest.java @@ -35,7 +35,6 @@ import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.ArtifactType; import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.category.CategoryDefinition; -import org.openecomp.sdc.be.model.operations.impl.ElementOperation; import org.openecomp.sdc.be.model.operations.impl.util.OperationTestsUtil; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperationTest.java index a71f97871f..8b4ebbdaf8 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/HeatParametersOperationTest.java @@ -20,10 +20,13 @@ package org.openecomp.sdc.be.model.operations.impl; -import static org.junit.Assert.*; -import static org.mockito.Matchers.anyMap; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.when; import java.util.ArrayList; @@ -42,7 +45,6 @@ import org.openecomp.sdc.be.model.HeatParameterDefinition; import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.heat.HeatParameterType; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.model.operations.impl.HeatParametersOperation; import org.openecomp.sdc.be.resources.data.HeatParameterData; import org.openecomp.sdc.be.resources.data.HeatParameterValueData; @@ -73,8 +75,8 @@ public class HeatParametersOperationTest extends ModelTestBase { GraphRelation graphRelation = new GraphRelation(); Either relationResult = Either.left(graphRelation); - when(titanGenericDao.createNode((HeatParameterData) anyObject(), eq(HeatParameterData.class))).thenReturn(either); - when(titanGenericDao.createRelation((GraphNode) anyObject(), (GraphNode) anyObject(), eq(GraphEdgeLabels.HEAT_PARAMETER), anyMap())).thenReturn(relationResult); + when(titanGenericDao.createNode(any(HeatParameterData.class), eq(HeatParameterData.class))).thenReturn(either); + when(titanGenericDao.createRelation(any(GraphNode.class), (GraphNode) any(GraphNode.class), eq(GraphEdgeLabels.HEAT_PARAMETER), anyMap())).thenReturn(relationResult); Either result = heatParametersOperation.addPropertyToGraph(propName, property, "resourceId.artifactId", NodeTypeEnum.ArtifactRef); @@ -100,8 +102,8 @@ public class HeatParametersOperationTest extends ModelTestBase { GraphRelation graphRelation = new GraphRelation(); Either relationResult = Either.left(graphRelation); - when(titanGenericDao.createNode((HeatParameterData) anyObject(), eq(HeatParameterData.class))).thenReturn(either); - when(titanGenericDao.createRelation((GraphNode) anyObject(), (GraphNode) anyObject(), eq(GraphEdgeLabels.HEAT_PARAMETER), anyMap())).thenReturn(relationResult); + when(titanGenericDao.createNode(any(HeatParameterData.class), eq(HeatParameterData.class))).thenReturn(either); + when(titanGenericDao.createRelation(any(GraphNode.class), any(GraphNode.class), eq(GraphEdgeLabels.HEAT_PARAMETER), anyMap())).thenReturn(relationResult); StorageOperationStatus result = heatParametersOperation.addPropertiesToGraph(parameters, "resourceId.artifactId", NodeTypeEnum.ArtifactRef); @@ -190,31 +192,6 @@ public class HeatParametersOperationTest extends ModelTestBase { assertEquals("false", propertyDefinition.getDefaultValue()); } - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "true")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "t")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "1")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "on")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "y")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "yes")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "false")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "f")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "0")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "off")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "n")); - // assertTrue(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, - // "no")); - assertFalse(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, "blabla")); assertFalse(heatParametersOperation.isValidValue(HeatParameterType.BOOLEAN, "2")); } @@ -256,9 +233,9 @@ public class HeatParametersOperationTest extends ModelTestBase { GraphRelation graphRelation = new GraphRelation(); Either relationResult = Either.left(graphRelation); - when(titanGenericDao.createNode((HeatParameterValueData) anyObject(), eq(HeatParameterValueData.class))).thenReturn(either); - when(titanGenericDao.createRelation((GraphNode) anyObject(), (GraphNode) anyObject(), eq(GraphEdgeLabels.PARAMETER_VALUE), anyMap())).thenReturn(relationResult); - when(titanGenericDao.createRelation((GraphNode) anyObject(), (GraphNode) anyObject(), eq(GraphEdgeLabels.PARAMETER_IMPL), anyMap())).thenReturn(relationResult); + when(titanGenericDao.createNode(any(HeatParameterValueData.class), eq(HeatParameterValueData.class))).thenReturn(either); + when(titanGenericDao.createRelation(any(GraphNode.class), any(GraphNode.class), eq(GraphEdgeLabels.PARAMETER_VALUE), anyMap())).thenReturn(relationResult); + when(titanGenericDao.createRelation(any(GraphNode.class), any(GraphNode.class), eq(GraphEdgeLabels.PARAMETER_IMPL), isNull())).thenReturn(relationResult); Either result = heatParametersOperation.addHeatValueToGraph(property, "artifactLabel", "resourceInstanceId.artifactId", "resourceInstanceId"); diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java index d1389f0f94..ae7944096a 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceOperationTest.java @@ -20,8 +20,8 @@ package org.openecomp.sdc.be.model.operations.impl; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import static org.junit.Assert.assertTrue; + import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -40,7 +40,8 @@ import org.slf4j.LoggerFactory; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.assertTrue; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:application-context-test.xml") diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PolicyTypeOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PolicyTypeOperationTest.java index ee129c6529..516ee51bab 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PolicyTypeOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PolicyTypeOperationTest.java @@ -38,7 +38,6 @@ import org.openecomp.sdc.be.datatypes.elements.PolicyTypeDataDefinition; import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.PolicyTypeDefinition; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.model.operations.impl.PolicyTypeOperation; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperationTest.java index 71d2b32a6f..d862c56790 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperationTest.java @@ -20,11 +20,10 @@ package org.openecomp.sdc.be.model.operations.impl; -import static org.junit.Assert.*; -import static org.mockito.Matchers.anyMap; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.when; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.Arrays; @@ -37,27 +36,17 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; -import org.openecomp.sdc.be.dao.graph.datatype.GraphRelation; -import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels; import org.openecomp.sdc.be.dao.titan.TitanGenericDao; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.elements.PropertyRule; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.PropertyConstraint; import org.openecomp.sdc.be.model.PropertyDefinition; -import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; -import org.openecomp.sdc.be.model.operations.impl.PropertyOperation; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; import org.openecomp.sdc.be.model.tosca.ToscaType; import org.openecomp.sdc.be.model.tosca.constraints.GreaterThanConstraint; import org.openecomp.sdc.be.model.tosca.constraints.InRangeConstraint; import org.openecomp.sdc.be.model.tosca.constraints.LessOrEqualConstraint; -import org.openecomp.sdc.be.resources.data.PropertyData; - -import fj.data.Either; public class PropertyOperationTest extends ModelTestBase { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java index f7072b2868..53bd753fa3 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.model.operations.impl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -42,13 +43,12 @@ import org.junit.rules.TestName; import org.junit.runner.RunWith; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; - import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; -import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.elements.CapabilityDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapDataDefinition; +import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; @@ -59,7 +59,6 @@ import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.ModelTestBase; import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; - import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType; import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperationTest.java index 3a8bb7f8e7..57689edb3d 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/UserAdminOperationTest.java @@ -20,7 +20,19 @@ package org.openecomp.sdc.be.model.operations.impl; -import fj.data.Either; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Graph; @@ -45,14 +57,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.resources.data.UserData; import org.openecomp.sdc.common.api.UserRoleEnum; -import java.time.Instant; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.*; +import fj.data.Either; public class UserAdminOperationTest extends ModelTestBase { private static final TitanGenericDao titanGenericDao = mock(TitanGenericDao.class); diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/DataTypeValidatorTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/DataTypeValidatorTest.java index 2b9c296eb5..9237095ad7 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/DataTypeValidatorTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/DataTypeValidatorTest.java @@ -20,11 +20,11 @@ package org.openecomp.sdc.be.model.operations.impl.util; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.lang.reflect.Type; import java.util.ArrayList; @@ -32,8 +32,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.Test; @@ -47,17 +45,14 @@ import org.openecomp.sdc.be.model.tosca.converters.MapConverter; import org.openecomp.sdc.be.model.tosca.validators.DataTypeValidatorConverter; import org.openecomp.sdc.be.model.tosca.validators.ListValidator; import org.openecomp.sdc.be.model.tosca.validators.MapValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; import fj.data.Either; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class DataTypeValidatorTest { private static Logger log = LoggerFactory.getLogger(DataTypeValidatorTest.class.getName()); diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/PrintGraph.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/PrintGraph.java index 4b89f457bb..d6a760a04a 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/PrintGraph.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/util/PrintGraph.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Property; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/serialize/TestResourceSerialization.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/serialize/TestResourceSerialization.java index 699e23affd..80109643be 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/serialize/TestResourceSerialization.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/serialize/TestResourceSerialization.java @@ -34,10 +34,8 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.StringJoiner; import java.util.stream.Collectors; -import org.junit.Test; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.common.util.SerializationUtils; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java index 0cea40fcec..8028813aaf 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca; -import javax.annotation.Generated; - import org.junit.Assert; import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraintTest.java index 8978c405b0..af8f28dd25 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraintTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.ToscaType; public class EqualConstraintTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterThanConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterThanConstraintTest.java index 001b09c517..7d959d4016 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterThanConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterThanConstraintTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.ToscaType; public class GreaterThanConstraintTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java index f7a040cf94..e1df65ef34 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.ToscaType; public class InRangeConstraintTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LengthConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LengthConstraintTest.java index 87781f0260..46a273b892 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LengthConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LengthConstraintTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LessOrEqualConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LessOrEqualConstraintTest.java index 6430802948..54d8725914 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LessOrEqualConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/LessOrEqualConstraintTest.java @@ -1,9 +1,6 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.ToscaType; public class LessOrEqualConstraintTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraintTest.java index ae0a50612d..55c70c51c3 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraintTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MinLengthConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MinLengthConstraintTest.java index 4263a6fe28..1b8694f49e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MinLengthConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/MinLengthConstraintTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/PatternConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/PatternConstraintTest.java index 1a20abbace..07c657ceac 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/PatternConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/PatternConstraintTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/ValidValuesConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/ValidValuesConstraintTest.java index 93622300c4..9b4c6b932d 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/ValidValuesConstraintTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/ValidValuesConstraintTest.java @@ -2,10 +2,7 @@ package org.openecomp.sdc.be.model.tosca.constraints; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.ToscaType; public class ValidValuesConstraintTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/BooleanConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/BooleanConverterTest.java index a37e8f6b4f..384c2d94ef 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/BooleanConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/BooleanConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverterTest.java index e15d784c7a..d5425504e6 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DataTypePropertyConverterTest.java @@ -1,19 +1,19 @@ package org.openecomp.sdc.be.model.tosca.converters; -import com.google.gson.JsonObject; -import org.junit.Before; -import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.be.model.PropertyDefinition; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; -import javax.json.Json; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; + +import com.google.gson.JsonObject; public class DataTypePropertyConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DefaultConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DefaultConverterTest.java index 111c4f84f1..d151f2aa27 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DefaultConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/DefaultConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/FloatConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/FloatConverterTest.java index d66182b966..1fb5c8cbf7 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/FloatConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/FloatConverterTest.java @@ -1,11 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class FloatConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatBooleanConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatBooleanConverterTest.java index 8f7aa6d849..41a08b3e66 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatBooleanConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatBooleanConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class HeatBooleanConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatCommaDelimitedListConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatCommaDelimitedListConverterTest.java index 9b3cb57028..636170601f 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatCommaDelimitedListConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatCommaDelimitedListConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class HeatCommaDelimitedListConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatJsonConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatJsonConverterTest.java index 4e5ee49b6d..1d13834748 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatJsonConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatJsonConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class HeatJsonConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatNumberConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatNumberConverterTest.java index 1594b00c77..93a54a7168 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatNumberConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatNumberConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class HeatNumberConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java index 3844bc81af..9f000a835a 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java @@ -2,11 +2,7 @@ package org.openecomp.sdc.be.model.tosca.converters; import static org.junit.Assert.assertEquals; -import java.util.Map; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class HeatStringConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/IntegerConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/IntegerConverterTest.java index 00bb834faf..8691ba00c5 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/IntegerConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/IntegerConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverterTest.java index 431443ab80..537b89509b 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/JsonConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ListConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ListConverterTest.java index a253ef07e8..7002f813c1 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ListConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ListConverterTest.java @@ -1,14 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; - -import fj.data.Either; public class ListConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/MapConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/MapConverterTest.java index 99f5e2716f..c837baa0ab 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/MapConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/MapConverterTest.java @@ -2,14 +2,9 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; -import fj.data.Either; - public class MapConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/StringConvertorTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/StringConvertorTest.java index a3a142d668..0cfdba83d2 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/StringConvertorTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/StringConvertorTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class StringConvertorTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaBooleanConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaBooleanConverterTest.java index c96c1244b6..d5eab58653 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaBooleanConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaBooleanConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class ToscaBooleanConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaFloatConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaFloatConverterTest.java index a8c5aeef66..5367dcb8a3 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaFloatConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaFloatConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class ToscaFloatConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaJsonValueConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaJsonValueConverterTest.java index 34eae243f7..dc7526eb0e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaJsonValueConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaJsonValueConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverterTest.java index a713c4ce6c..04ae0696a7 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverterTest.java @@ -1,12 +1,6 @@ package org.openecomp.sdc.be.model.tosca.converters; -import java.util.Map; - -import javax.annotation.Generated; - -import org.junit.Assert; import org.junit.Test; -import org.openecomp.sdc.be.model.DataTypeDefinition; public class ToscaListValueConverterTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaStringConvertorTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaStringConvertorTest.java index 8365c0345a..a9909b882f 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaStringConvertorTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaStringConvertorTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaValueDefaultConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaValueDefaultConverterTest.java index b9ae07cb76..ea9a4a8eb7 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaValueDefaultConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/ToscaValueDefaultConverterTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.model.tosca.converters; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.DataTypeDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/validators/IntegerValidatorTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/validators/IntegerValidatorTest.java index 2dfe9a8de7..aff1750344 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/validators/IntegerValidatorTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/validators/IntegerValidatorTest.java @@ -20,15 +20,10 @@ package org.openecomp.sdc.be.model.tosca.validators; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertNotNull; -import javax.validation.constraints.AssertTrue; +import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.openecomp.sdc.be.model.tosca.validators.IntegerValidator; public class IntegerValidatorTest { private static IntegerValidator validator = IntegerValidator.getInstance(); diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/ComparableVersionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/ComparableVersionTest.java index 5d0c34d037..5e1d37851e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/ComparableVersionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/ComparableVersionTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.model.tosca.version; -import javax.annotation.Generated; - import org.junit.Test; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/VersionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/VersionTest.java index 8b259f7cb8..cf848901e5 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/VersionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/version/VersionTest.java @@ -1,9 +1,5 @@ package org.openecomp.sdc.be.model.tosca.version; -import java.util.StringTokenizer; - -import javax.annotation.Generated; - import org.junit.Test; public class VersionTest { diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java index b57342f637..c0d69fae76 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.category.CategoryDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java index 52767a2934..4fd0ccc944 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.AdditionalInformationDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java index 040b94520f..e50b6c4633 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java @@ -3,8 +3,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.AdditionalInformationDefinition; import org.openecomp.sdc.be.model.InterfaceDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java index 9248b4d176..eb5ccff438 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.List; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java index 83a1281172..3bb5aa10b0 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java @@ -2,8 +2,6 @@ package org.openecomp.sdc.be.ui.model; import java.util.Map; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.model.ArtifactDefinition; diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java index 1d203b1ce3..712053c2f6 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java @@ -1,7 +1,5 @@ package org.openecomp.sdc.be.ui.model; -import javax.annotation.Generated; - import org.junit.Test; import org.openecomp.sdc.be.datatypes.components.ServiceMetadataDataDefinition; diff --git a/catalog-ui/configurations/dev.js b/catalog-ui/configurations/dev.js index b68842c3fc..8367963adf 100644 --- a/catalog-ui/configurations/dev.js +++ b/catalog-ui/configurations/dev.js @@ -61,7 +61,7 @@ const SDC_CONFIG = { }, "resourceTypesFilter":{ "resource":["CP","VFC","VL"], - "service":["CP","VF","VL", "PNF","CVFC"] + "service":["CP","VF","VL", "PNF","CVFC","SERVICE", "Configuration"] }, "logConfig": { "minLogLevel": "debug", diff --git a/catalog-ui/configurations/prod.js b/catalog-ui/configurations/prod.js index 971263b710..0891f8d572 100644 --- a/catalog-ui/configurations/prod.js +++ b/catalog-ui/configurations/prod.js @@ -61,7 +61,7 @@ const SDC_CONFIG = { }, "resourceTypesFilter":{ "resource":["CP","VFC","VL"], - "service":["CP","VF","VL", "PNF","CVFC"] + "service":["CP","VF","VL", "PNF","CVFC","SERVICE","Configuration"] }, "logConfig": { "minLogLevel": "debug", diff --git a/catalog-ui/package.json b/catalog-ui/package.json index d384a9c119..9dd0620ea9 100644 --- a/catalog-ui/package.json +++ b/catalog-ui/package.json @@ -45,7 +45,7 @@ "raw-loader": "^0.5.1", "sass-loader": "^4.1.1", "script-loader": "^0.7.0", - "sdc-ui": "1.6.2", + "sdc-ui": "1.6.9", "source-map-loader": "^0.1.5", "style-loader": "^0.13.1", "url-loader": "^0.5.7", diff --git a/catalog-ui/src/app/app.ts b/catalog-ui/src/app/app.ts index 805e5f0b5d..609ed48f3e 100644 --- a/catalog-ui/src/app/app.ts +++ b/catalog-ui/src/app/app.ts @@ -31,18 +31,17 @@ import './modules/service-module'; import './modules/view-model-module.ts'; import { - IUserResourceClass, DataTypesService, LeftPaletteLoaderService, EcompHeaderService, CookieService, ConfigurationUiService, CacheService, - IUserResource, SdcVersionService, ICategoryResourceClass, EntityService } from "./services"; +import { UserService } from "./ng2/services/user.service"; import {forwardRef} from '@angular/core'; import {UpgradeAdapter} from '@angular/upgrade'; import {CHANGE_COMPONENT_CSAR_VERSION_FLAG, States} from "./utils"; @@ -53,11 +52,12 @@ import {downgradeComponent} from "@angular/upgrade/static"; import {AppModule} from './ng2/app.module'; import {PropertiesAssignmentComponent} from "./ng2/pages/properties-assignment/properties-assignment.page.component"; -import { SearchWithAutoCompleteComponent } from "./ng2/shared/search-with-autocomplete/search-with-autocomplete.component"; import {Component} from "./models/components/component"; import {ComponentServiceNg2} from "./ng2/services/component-services/component.service"; import {ComponentMetadata} from "./models/component-metadata"; import {Categories} from "./models/categories"; +import {IUserProperties} from "./models/user"; +import {SearchWithAutoCompleteComponent} from "./ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component"; let moduleName:string = 'sdcApp'; @@ -225,7 +225,13 @@ ng1appModule.config([ resolve: { injectComponent: ['$stateParams', 'ComponentFactory', 'ComponentServiceNg2', function ($stateParams, ComponentFactory:ComponentFactory, ComponentServiceNg2:ComponentServiceNg2) { if ($stateParams.id) { - return ComponentFactory.getComponentWithMetadataFromServer($stateParams.type.toUpperCase(), $stateParams.id); + return ComponentFactory.getComponentWithMetadataFromServer($stateParams.type.toUpperCase(), $stateParams.id).then( + (component:Component)=> { + if ($stateParams.componentCsar){ + component = ComponentFactory.updateComponentFromCsar($stateParams.componentCsar, component); + } + return component; + }); } else if ($stateParams.componentCsar && $stateParams.componentCsar.csarUUID) { return $stateParams.componentCsar; } else { @@ -546,8 +552,8 @@ ng1appModule.config([ templateUrl: './view-models/catalog/catalog-view.html', controller: viewModelsModuleName + '.CatalogViewModel', resolve: { - auth: ["$q", "Sdc.Services.UserResourceService", ($q:any, userResourceService:IUserResourceClass) => { - let userInfo:IUserResource = userResourceService.getLoggedinUser(); + auth: ["$q", "UserServiceNg2", ($q:any, userService:UserService) => { + let userInfo:IUserProperties = userService.getLoggedinUser(); if (userInfo) { return $q.when(userInfo); } else { @@ -592,6 +598,7 @@ ng1appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/); ng1appModule.value('VendorReleaseValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/); ng1appModule.value('VendorNameValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,60}$/); ng1appModule.value('VendorModelNumberValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,65}$/); +ng1appModule.value('ServiceTypeAndRoleValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,256}$/); ng1appModule.value('ContactIdValidationPattern', /^[\s\w-]{1,50}$/); ng1appModule.value('UserIdValidationPattern', /^[\s\w-]{1,50}$/); ng1appModule.value('ProjectCodeValidationPattern', /^[\s\w-]{5,50}$/); @@ -614,7 +621,7 @@ ng1appModule.run([ 'Sdc.Services.CacheService', 'Sdc.Services.CookieService', 'Sdc.Services.ConfigurationUiService', - 'Sdc.Services.UserResourceService', + 'UserServiceNg2', 'Sdc.Services.CategoryResourceService', 'Sdc.Services.SdcVersionService', '$state', @@ -631,7 +638,7 @@ ng1appModule.run([ cacheService:CacheService, cookieService:CookieService, ConfigurationUi:ConfigurationUiService, - UserResourceClass:IUserResourceClass, + userService:UserService, categoryResourceService:ICategoryResourceClass, sdcVersionService:SdcVersionService, $state:ng.ui.IStateService, @@ -644,6 +651,7 @@ ng1appModule.run([ DataTypesService:DataTypesService, AngularJSBridge, $templateCache:ng.ITemplateCacheService):void => { + $templateCache.put('notification-custom-template.html', require('./view-models/shared/notification-custom-template.html')); $templateCache.put('notification-custom-template.html', require('./view-models/shared/notification-custom-template.html')); //handle cache data - version let initAsdcVersion:Function = ():void => { @@ -756,27 +764,27 @@ ng1appModule.run([ toParams.previousState = fromParams.previousState; } - if (toState.name !== 'error-403' && !UserResourceClass.getLoggedinUser()) { + if (toState.name !== 'error-403' && !userService.getLoggedinUser()) { internalDeregisterStateChangeStartWatcher(); event.preventDefault(); - UserResourceClass.authorize().$promise.then((user:IUserResource) => { - if (!doesUserHasAccess(toState, user)) { + userService.authorize().subscribe((userInfo:IUserProperties) => { + if (!doesUserHasAccess(toState, userInfo)) { $state.go('error-403'); console.info('User has no permissions'); registerStateChangeStartWatcher(); return; } - UserResourceClass.setLoggedinUser(user); - cacheService.set('user', user); + userService.setLoggedinUser(userInfo); + cacheService.set('user', userInfo); initCategories(); - // initEcompMenu(user); + // initEcompMenu(userInfo); setTimeout(function () { removeLoader(); // initCategories(); - if (UserResourceClass.getLoggedinUser().role === 'ADMIN') { + if (userService.getLoggedinUser().role === 'ADMIN') { // toState.name = "adminDashboard"; $state.go("adminDashboard", toParams); registerStateChangeStartWatcher(); @@ -804,9 +812,9 @@ ng1appModule.run([ registerStateChangeStartWatcher(); }); } - else if (UserResourceClass.getLoggedinUser()) { + else if (userService.getLoggedinUser()) { internalDeregisterStateChangeStartWatcher(); - if (!doesUserHasAccess(toState, UserResourceClass.getLoggedinUser())) { + if (!doesUserHasAccess(toState, userService.getLoggedinUser())) { event.preventDefault(); $state.go('error-403'); console.info('User has no permissions'); diff --git a/catalog-ui/src/app/directives/capabilities-and-requirements/requirement/requirements-list-directive.ts b/catalog-ui/src/app/directives/capabilities-and-requirements/requirement/requirements-list-directive.ts index 1c5c333d27..14cafa98c4 100644 --- a/catalog-ui/src/app/directives/capabilities-and-requirements/requirement/requirements-list-directive.ts +++ b/catalog-ui/src/app/directives/capabilities-and-requirements/requirement/requirements-list-directive.ts @@ -28,7 +28,7 @@ * Created by obarda on 1/8/2017. */ 'use strict'; -import {RequirementsGroup, Component} from "app/models"; +import {RequirementsGroup, Component, Relationship, RelationshipModel} from "app/models"; export interface IRequirementsListScope extends ng.IScope { @@ -62,12 +62,11 @@ export class RequirementsListDirective implements ng.IDirective { scope.getRelation = (requirement:any):any => { if (scope.isInstanceSelected() && scope.component.componentInstancesRelations) { - let relationItem = _.filter(scope.component.componentInstancesRelations, (relation:any) => { + let relationItem:Array = _.filter((scope.component).componentInstancesRelations, (relation:RelationshipModel) => { return relation.fromNode === scope.component.selectedInstance.uniqueId && - _.some(relation.relationships, { - 'requirement': requirement.name, - 'requirementOwnerId': requirement.ownerId - }); + _.filter(relation.relationships, (relationship:Relationship) => { + return relationship.relation.requirement == requirement.name && relationship.relation.requirementOwnerId == requirement.ownerId; + }).length; }); if (relationItem && relationItem.length) { diff --git a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.html b/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.html deleted file mode 100644 index a50731443d..0000000000 --- a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.html +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.less b/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.less deleted file mode 100644 index 4c54a11fec..0000000000 --- a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.less +++ /dev/null @@ -1,47 +0,0 @@ - -.footer-wrapper { - position: fixed; - bottom: 0px; - left: 0px; - width: 100%; - background-color: #222222; - color: #ffffff; - font-family: "Arial"; - font-size: 11px; - height: @footer_height; -} - -.footer-wrapper a { - color: #ffffff; - margin: 0; - padding: 0; - text-decoration: underline; -} - -.divider-footer-bottom { - margin: 0 auto; - width: 1020px; -} - -.footer-copyright-text { - display: inline-block; - width:612px; - margin-top: 18px; - margin-left: 50px; - text-align: left; - vertical-align: top; -} - -.footer-logo1 { - display: inline-block; - margin-top: 20px; - margin-left: 124px; -} - -.footer-logo2 { - margin-top: 22px; - margin-left: 9px; - display: inline-block; - font-size: 24px; - vertical-align: top; -} diff --git a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.ts b/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.ts deleted file mode 100644 index 7796f60d70..0000000000 --- a/catalog-ui/src/app/directives/ecomp-footer/ecomp-footer.ts +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -'use strict'; -import {IAppConfigurtaion} from "app/models"; - -export interface IEcompFooterDirectiveScope extends ng.IScope { - -} - -export class EcompFooterDirective implements ng.IDirective { - - constructor(private sdcConfig:IAppConfigurtaion) { - - } - - public replace = true; - public restrict = 'E'; - - public scope = {}; - - template = ():string => { - return require('./ecomp-footer.html'); - }; - - link = (scope:IEcompFooterDirectiveScope, $elem:JQuery, attr:any) => { - - }; - - public static factory = (sdcConfig:IAppConfigurtaion)=> { - return new EcompFooterDirective(sdcConfig); - }; - -} - -EcompFooterDirective.factory.$inject = ['sdcConfig']; diff --git a/catalog-ui/src/app/directives/ecomp-header/ecomp-header.ts b/catalog-ui/src/app/directives/ecomp-header/ecomp-header.ts index 7d616afba6..f73c82a190 100644 --- a/catalog-ui/src/app/directives/ecomp-header/ecomp-header.ts +++ b/catalog-ui/src/app/directives/ecomp-header/ecomp-header.ts @@ -20,7 +20,8 @@ 'use strict'; import {IAppConfigurtaion, User, IUser} from "app/models"; -import {IUserResourceClass, IUserResource} from "app/services"; +import {IUserProperties} from "../../models/user"; +import {UserService} from "../../ng2/services/user.service"; export class MenuItem { menuId:number; @@ -55,7 +56,7 @@ export class EcompHeaderDirective implements ng.IDirective { constructor(private $http:ng.IHttpService, private sdcConfig:IAppConfigurtaion, - private UserResourceClass:IUserResourceClass) { + private userService:UserService) { } @@ -90,14 +91,14 @@ export class EcompHeaderDirective implements ng.IDirective { let initUser = ():void => { let defaultUserId:string; - let user:IUserResource = this.UserResourceClass.getLoggedinUser(); - if (!user) { + let userInfo:IUserProperties = this.userService.getLoggedinUser(); + if (!userInfo) { defaultUserId = this.$http.defaults.headers.common[this.sdcConfig.cookie.userIdSuffix]; - user = this.UserResourceClass.get({id: defaultUserId}, ():void => { - $scope.user = new User(user); + this.userService.getUser(defaultUserId).subscribe((defaultUserInfo):void => { + $scope.user = new User(defaultUserInfo); }); } else { - $scope.user = new User(user); + $scope.user = new User(userInfo); } }; @@ -135,8 +136,8 @@ export class EcompHeaderDirective implements ng.IDirective { public static factory = ($http:ng.IHttpService, sdcConfig:IAppConfigurtaion, - UserResourceClass:IUserResourceClass)=> { - return new EcompHeaderDirective($http, sdcConfig, UserResourceClass); + userService:UserService)=> { + return new EcompHeaderDirective($http, sdcConfig, userService); }; } @@ -229,7 +230,7 @@ export class EcompHeaderController { }; } -EcompHeaderDirective.factory.$inject = ['$http', 'sdcConfig', 'Sdc.Services.UserResourceService']; +EcompHeaderDirective.factory.$inject = ['$http', 'sdcConfig', 'UserServiceNg2']; diff --git a/catalog-ui/src/app/directives/graphs-v2/common/common-graph-utils.ts b/catalog-ui/src/app/directives/graphs-v2/common/common-graph-utils.ts index f88db47524..2a7fd74e53 100644 --- a/catalog-ui/src/app/directives/graphs-v2/common/common-graph-utils.ts +++ b/catalog-ui/src/app/directives/graphs-v2/common/common-graph-utils.ts @@ -164,12 +164,54 @@ export class CommonGraphUtils { if (!this.isRelationCertified(cy.nodes(), link.source, link.target)) { link.classes = 'not-certified-link'; } - cy.add({ + let linkElement = cy.add({ group: 'edges', data: link, classes: link.classes }); + this.initLinkTooltip(linkElement, link); + }; + + /** + * This function will init qtip tooltip on the link + * @params linkElement - the link we want the tooltip to apply on, + * link - the link obj + */ + public initLinkTooltip(linkElement:Cy.CollectionElements, link:CompositionCiLinkBase) { + + let opts = { + content: function () { + return '
' + + 'R: ' + + ''+ link.relation.relationships[0].relation.requirement + '' + + '
' + + '
' + + '' + + 'C: ' + + '' + link.relation.relationships[0].relation.capability + '' + + '
'; + }, + position: { + my: 'top center', + at: 'bottom center', + adjust: {x:0, y:0} + }, + style: { + classes: 'qtip-dark qtip-rounded qtip-custom link-qtip', + tip: { + width: 16, + height: 8 + } + }, + show: { + event: 'mouseover', + delay: 1000 + }, + hide: {event: 'mouseout mousedown'}, + includeLabels: true + }; + linkElement.qtip(opts); }; /** diff --git a/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts b/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts index 7e21f8293b..36c75c55fc 100644 --- a/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts +++ b/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts @@ -225,6 +225,23 @@ export class ComponentInstanceNodesStyle { css: { 'overlay-opacity': 0 } + }, { + selector: '.configuration-node', + css: { + 'background-color': 'rgb(255,255,255)', + 'shape': 'rectangle', + 'label': 'data(displayName)', + 'background-image': 'data(img)', + 'background-width': GraphUIObjects.SMALL_RESOURCE_WIDTH, + 'background-height': GraphUIObjects.SMALL_RESOURCE_WIDTH, + 'width': GraphUIObjects.SMALL_RESOURCE_WIDTH, + 'height': GraphUIObjects.SMALL_RESOURCE_WIDTH, + 'text-valign': 'bottom', + 'text-halign': 'center', + 'background-opacity': 0, + 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR, + 'overlay-opacity': 0 + } } ] } diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts index 8b3a59ec1f..cdb163bda1 100644 --- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts +++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.directive.ts @@ -19,14 +19,20 @@ */ import { - MatchBase, + Match, LinkMenu, ComponentInstance, LeftPaletteComponent, + Capability, + Requirement, + Relationship, + PropertyModel, Component, - RelationMenuDirectiveObj, + ConnectRelationModel, CompositionCiNodeBase, CompositionCiNodeVl, + ModalModel, + ButtonModel, NodesFactory/*, AssetPopoverObj*/ } from "app/models"; @@ -42,6 +48,18 @@ import {ComponentInstanceNodesStyle} from "../common/style/component-instances-n import {CytoscapeEdgeEditation} from 'third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js'; import {ComponentServiceNg2} from "../../../ng2/services/component-services/component.service"; import {ComponentGenericResponse} from "../../../ng2/services/responses/component-generic-response"; +import {ModalService} from "../../../ng2/services/modal.service"; + +import {ConnectionWizardService} from "../../../ng2/pages/connection-wizard/connection-wizard.service"; +import {StepModel} from "../../../models/wizard-step"; +import {FromNodeStepComponent} from "app/ng2/pages/connection-wizard/from-node-step/from-node-step.component"; +import {PropertiesStepComponent} from "app/ng2/pages/connection-wizard/properties-step/properties-step.component"; +import {ToNodeStepComponent} from "app/ng2/pages/connection-wizard/to-node-step/to-node-step.component"; +import {ConnectionWizardHeaderComponent} from "app/ng2/pages/connection-wizard/connection-wizard-header/connection-wizard-header.component"; +import {ConnectionPropertiesViewComponent} from "../../../ng2/pages/connection-wizard/connection-properties-view/connection-properties-view.component"; +import {ComponentInstanceServiceNg2} from "../../../ng2/services/component-instance-services/component-instance.service"; +import {EVENTS} from "../../../utils/constants"; +import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model"; interface ICompositionGraphScope extends ng.IScope { @@ -50,9 +68,10 @@ interface ICompositionGraphScope extends ng.IScope { isViewOnly: boolean; withSidebar: boolean; // Link menu - create link menu - relationMenuDirectiveObj:RelationMenuDirectiveObj; + relationMenuDirectiveObj:ConnectRelationModel; isLinkMenuOpen:boolean; - createLinkFromMenu:(chosenMatch:MatchBase, vl:Component)=>void; + createLinkFromMenu:(chosenMatch:Match, vl:Component)=>void; + saveChangedCapabilityProperties:()=>Promise; //modify link menu - for now only delete menu relationMenuTimeout:ng.IPromise; @@ -64,6 +83,7 @@ interface ICompositionGraphScope extends ng.IScope { verifyDrop(event:JQueryEventObject, ui:any):void; //Links menus + viewRelation(link:Cy.CollectionEdges):void; deleteRelation(link:Cy.CollectionEdges):void; hideRelationMenu(); @@ -73,6 +93,8 @@ interface ICompositionGraphScope extends ng.IScope { zoomAll(nodes?:Cy.CollectionNodes): void; getAutoCompleteValues(searchTerm: string):void; highlightSearchMatches(searchTerm: string): void; + + canvasMenuProps:any; /*//asset popover menu assetPopoverObj:AssetPopoverObj; @@ -102,7 +124,10 @@ export class CompositionGraph implements ng.IDirective { private commonGraphUtils:CommonGraphUtils, private matchCapabilitiesRequirementsUtils:MatchCapabilitiesRequirementsUtils, private CompositionGraphPaletteUtils:CompositionGraphPaletteUtils, - private ComponentServiceNg2: ComponentServiceNg2) { + private ComponentServiceNg2: ComponentServiceNg2, + private ModalServiceNg2: ModalService, + private ConnectionWizardServiceNg2: ConnectionWizardService, + private ComponentInstanceServiceNg2: ComponentInstanceServiceNg2) { } @@ -131,6 +156,8 @@ export class CompositionGraph implements ng.IDirective { _.forEach(GRAPH_EVENTS, (event) => { this.eventListenerService.unRegisterObserver(event); }); + this.eventListenerService.unRegisterObserver(EVENTS.SHOW_LOADER_EVENT + 'composition-graph'); + this.eventListenerService.unRegisterObserver(EVENTS.HIDE_LOADER_EVENT + 'composition-graph'); }); }; @@ -190,7 +217,7 @@ export class CompositionGraph implements ng.IDirective { if (this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.containsKey(leftPaletteComponent.uniqueId)) { let cacheComponent = this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.getValue(leftPaletteComponent.uniqueId); - let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(cacheComponent, nodesData, nodesLinks); + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findMatchingNodes(cacheComponent, nodesData, nodesLinks); this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy); this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy); @@ -207,7 +234,7 @@ export class CompositionGraph implements ng.IDirective { component.capabilities = response.capabilities; component.requirements = response.requirements; this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.setValue(leftPaletteComponent.uniqueId, component); - let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(component, nodesData, nodesLinks); + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findMatchingNodes(component, nodesData, nodesLinks); this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy); this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy) }); @@ -321,18 +348,124 @@ export class CompositionGraph implements ng.IDirective { scope.zoomAll(matchingNodes); }; - scope.createLinkFromMenu = (chosenMatch:MatchBase):void => { + scope.saveChangedCapabilityProperties = ():Promise => { + return new Promise((resolve) => { + const capabilityPropertiesBE: PropertyBEModel[] = this.ConnectionWizardServiceNg2.changedCapabilityProperties.map((prop) => { + prop.value = prop.getJSONValue(); + const propBE = new PropertyBEModel(prop); + propBE.parentUniqueId = this.ConnectionWizardServiceNg2.selectedMatch.relationship.relation.capabilityOwnerId; + return propBE; + }); + if (capabilityPropertiesBE.length > 0) { + // if there are capability properties to update, then first update capability properties and then resolve promise + this.ComponentInstanceServiceNg2 + .updateInstanceCapabilityProperties( + scope.component, + this.ConnectionWizardServiceNg2.selectedMatch.toNode, + this.ConnectionWizardServiceNg2.selectedMatch.capability.type, + this.ConnectionWizardServiceNg2.selectedMatch.capability.name, + capabilityPropertiesBE + ) + .subscribe((response) => { + console.log("Update resource instance capability properties response: ", response); + response.forEach((resProperty) => { + this.ConnectionWizardServiceNg2.selectedMatch.capabilityProperties.find((property) => { + return property.uniqueId == resProperty.uniqueId; + }).value = resProperty.value; + }); + this.ConnectionWizardServiceNg2.changedCapabilityProperties = []; + resolve(capabilityPropertiesBE); + }); + } else { + // no capability properties to update, immediately resolve promise + resolve(capabilityPropertiesBE); + } + }); + }; + + scope.createLinkFromMenu = ():void => { scope.isLinkMenuOpen = false; - this.CompositionGraphLinkUtils.createLinkFromMenu(this._cy, chosenMatch, scope.component); + + scope.saveChangedCapabilityProperties().then(() => { + //create link: + this.CompositionGraphLinkUtils + .createLinkFromMenu(this._cy, this.ConnectionWizardServiceNg2.selectedMatch, scope.component); + }); }; scope.hideRelationMenu = () => { this.commonGraphUtils.safeApply(scope, () => { - scope.linkMenuObject = null; + delete scope.canvasMenuProps; this.$timeout.cancel(scope.relationMenuTimeout); }); }; + scope.viewRelation = (link:Cy.CollectionEdges) => { + scope.hideRelationMenu(); + + const linkData = link.data(); + const sourceNode:CompositionCiNodeBase = link.source().data(); + const targetNode:CompositionCiNodeBase = link.target().data(); + const relationship:Relationship = linkData.relation.relationships[0]; + + let capability:Capability; + _.some(_.values(targetNode.componentInstance.capabilities), (capGroup) => { + //item.uniqueId + item.ownerId + item.name === (selectedReqOrCapModel.uniqueId + selectedReqOrCapModel.ownerId + selectedReqOrCapModel.name) + capability = _.find(_.values(capGroup), (cap:Capability) => ( + cap.uniqueId === relationship.relation.capabilityUid && + cap.ownerId === relationship.relation.capabilityOwnerId && + cap.name === relationship.relation.capability + )); + return capability; + }); + let requirement:Requirement; + _.some(_.values(sourceNode.componentInstance.requirements), (reqGroup) => { + requirement = _.find(_.values(reqGroup), (req:Requirement) => ( + req.uniqueId === relationship.relation.requirementUid && + req.ownerId === relationship.relation.requirementOwnerId && + req.name === relationship.relation.requirement + )); + return requirement; + }); + + new Promise<{capability:Capability, requirement:Requirement}>((resolve, reject) => { + if (capability && requirement) { + resolve({capability, requirement}); + } + else { + scope.component.fetchRelation(relationship.relation.id).then((fetchedRelation) => { + resolve({ + capability: fetchedRelation.relationships[0].capability, + requirement: fetchedRelation.relationships[0].requirement + }); + }, reject); + } + }).then((objReqCap) => { + capability = objReqCap.capability; + requirement = objReqCap.requirement; + + this.ConnectionWizardServiceNg2.currentComponent = scope.component; + this.ConnectionWizardServiceNg2.connectRelationModel = new ConnectRelationModel(sourceNode, targetNode, []); + this.ConnectionWizardServiceNg2.selectedMatch = new Match(requirement, capability, true, linkData.source, linkData.target); + this.ConnectionWizardServiceNg2.selectedMatch.relationship = relationship; + + const title = `Connection Properties`; + const saveButton: ButtonModel = new ButtonModel('Save', 'blue', () => { + scope.saveChangedCapabilityProperties().then(() => { this.ModalServiceNg2.closeCurrentModal(); }) + }); + const cancelButton: ButtonModel = new ButtonModel('Cancel', 'white', () => { this.ModalServiceNg2.closeCurrentModal(); }); + const modal = new ModalModel('xl', title, '', [saveButton, cancelButton]); + const modalInstance = this.ModalServiceNg2.createCustomModal(modal); + this.ModalServiceNg2.addDynamicContentToModal(modalInstance, ConnectionPropertiesViewComponent); + modalInstance.instance.open(); + + this.ComponentInstanceServiceNg2.getInstanceCapabilityProperties(scope.component, linkData.target, capability.type, capability.name) + .subscribe((response: Array) => { + this.ConnectionWizardServiceNg2.selectedMatch.capabilityProperties = response; + this.ModalServiceNg2.addDynamicContentToModal(modalInstance, ConnectionPropertiesViewComponent); + }, (error) => {}); + }, (error) => {}); + }; scope.deleteRelation = (link:Cy.CollectionEdges) => { scope.hideRelationMenu(); @@ -367,9 +500,26 @@ export class CompositionGraph implements ng.IDirective { this._cy.on('addedgemouseup', (event, data) => { scope.relationMenuDirectiveObj = this.CompositionGraphLinkUtils.onLinkDrawn(this._cy, data.source, data.target); if (scope.relationMenuDirectiveObj != null) { - scope.$apply(() => { - scope.isLinkMenuOpen = true; - }); + this.ConnectionWizardServiceNg2.setRelationMenuDirectiveObj(scope.relationMenuDirectiveObj); + this.ConnectionWizardServiceNg2.currentComponent = scope.component; + //TODO: init with the selected values + this.ConnectionWizardServiceNg2.selectedMatch = null; + + let steps:Array = []; + let fromNodeName:string = scope.relationMenuDirectiveObj.fromNode.componentInstance.name; + let toNodeName:string = scope.relationMenuDirectiveObj.toNode.componentInstance.name; + steps.push(new StepModel(fromNodeName, FromNodeStepComponent)); + steps.push(new StepModel(toNodeName, ToNodeStepComponent)); + steps.push(new StepModel('Properties', PropertiesStepComponent)); + let wizardTitle = 'Connect: ' + fromNodeName + ' to ' + toNodeName; + let modalInstance = this.ModalServiceNg2.createMultiStepsWizard(wizardTitle, steps, scope.createLinkFromMenu, ConnectionWizardHeaderComponent); + modalInstance.instance.open(); + + // + // this.ModalServiceNg2.createMultiStepsWizard('Connect', )Connect + // scope.$apply(() => { + // scope.isLinkMenuOpen = true; + // }); } }); this._cy.on('tapstart', 'node', (event:Cy.EventObject) => { @@ -424,7 +574,7 @@ export class CompositionGraph implements ng.IDirective { let nodesLinks = this.GeneralGraphUtils.getAllCompositionCiLinks(this._cy); let linkableNodes = this.commonGraphUtils.getLinkableNodes(this._cy, payload.node); - let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(payload.node.data().componentInstance, linkableNodes, nodesLinks); + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findMatchingNodes(payload.node.data().componentInstance, linkableNodes, nodesLinks); this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy); this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy, payload.node.data()); @@ -498,14 +648,39 @@ export class CompositionGraph implements ng.IDirective { };*/ private openModifyLinkMenu = (scope:ICompositionGraphScope, linkMenuObject:LinkMenu, timeOutInMilliseconds?:number) => { + scope.hideRelationMenu(); + this.$timeout(() => { + scope.canvasMenuProps = { + open: true, + styleClass: 'w-sdc-canvas-menu-list', + items: [], + position: { + x: `${linkMenuObject.position.x}px`, + y: `${linkMenuObject.position.y}px` + } + }; + + if (this._cy.$('edge:selected').length === 1) { + scope.canvasMenuProps.items.push({ + contents: 'View', + styleClass: 'w-sdc-canvas-menu-item-view', + action: () => { + scope.viewRelation(linkMenuObject.link); + } + }); + } + scope.canvasMenuProps.items.push({ + contents: 'Delete', + styleClass: 'w-sdc-canvas-menu-item-delete', + action: () => { + scope.deleteRelation(linkMenuObject.link); + } + }); - this.commonGraphUtils.safeApply(scope, () => { - scope.linkMenuObject = linkMenuObject; + scope.relationMenuTimeout = this.$timeout(() => { + scope.hideRelationMenu(); + }, timeOutInMilliseconds ? timeOutInMilliseconds : 6000); }); - - scope.relationMenuTimeout = this.$timeout(() => { - scope.hideRelationMenu(); - }, timeOutInMilliseconds ? timeOutInMilliseconds : 6000); }; private initGraphNodes(componentInstances:ComponentInstance[], isViewOnly:boolean) { @@ -571,7 +746,10 @@ export class CompositionGraph implements ng.IDirective { CommonGraphUtils, MatchCapabilitiesRequirementsUtils, CompositionGraphPaletteUtils, - ComponentServiceNg2) => { + ComponentServiceNg2, + ModalService, + ConnectionWizardService, + ComponentInstanceServiceNg2) => { return new CompositionGraph( $q, $log, @@ -587,7 +765,10 @@ export class CompositionGraph implements ng.IDirective { CommonGraphUtils, MatchCapabilitiesRequirementsUtils, CompositionGraphPaletteUtils, - ComponentServiceNg2); + ComponentServiceNg2, + ModalService, + ConnectionWizardService, + ComponentInstanceServiceNg2); } } @@ -606,5 +787,8 @@ CompositionGraph.factory.$inject = [ 'CommonGraphUtils', 'MatchCapabilitiesRequirementsUtils', 'CompositionGraphPaletteUtils', - 'ComponentServiceNg2' + 'ComponentServiceNg2', + 'ModalServiceNg2', + 'ConnectionWizardServiceNg2', + 'ComponentInstanceServiceNg2' ]; diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.html b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.html index 248f19fb70..bbf2d6bbb2 100644 --- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.html +++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/composition-graph.html @@ -8,17 +8,7 @@ - -
- -
-
- Delete -
- -
+
= this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromUcpeInstance, toComponentInstance, this.getAllCompositionCiLinks(cy)); - let hostedOnMatch:MatchBase = _.find(matches, (match:MatchReqToCapability) => { + let matches:Array = this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromUcpeInstance, toComponentInstance, this.getAllCompositionCiLinks(cy)); + let hostedOnMatch:Match = _.find(matches, (match:Match) => { return match.requirement.capability.toLowerCase() === 'tosca.capabilities.container'; }); - return hostedOnMatch; + return hostedOnMatch; }; @@ -128,7 +128,7 @@ export class CompositionGraphGeneralUtils { */ private isValidDropInsideUCPE(cy:Cy.Instance, nodeToInsert:ComponentInstance, ucpeNode:ComponentInstance):boolean { - let hostedOnMatch:MatchReqToCapability = this.canBeHostedOn(cy, ucpeNode, nodeToInsert); + let hostedOnMatch:Match = this.canBeHostedOn(cy, ucpeNode, nodeToInsert); let result:boolean = !angular.isUndefined(hostedOnMatch) || nodeToInsert.isVl(); //group validation return result; diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts index 05f99ae9ea..89c5e14602 100644 --- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts +++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts @@ -21,25 +21,17 @@ /** * Created by obarda on 6/28/2016. */ -import {GraphUIObjects, ComponentInstanceFactory, ResourceType} from "app/utils"; -import {LeftPaletteLoaderService, LoaderService} from "app/services"; +import {GraphUIObjects} from "app/utils"; +import {LoaderService} from "app/services"; import { NodeUcpe, CompositionCiNodeVf, - MatchReqToCapability, - MatchBase, - MatchReqToReq, - ComponentInstance, + Match, CompositionCiNodeBase, RelationshipModel, - RelationMenuDirectiveObj, - CapabilitiesGroup, + ConnectRelationModel, LinksFactory, - NodesFactory, - RequirementsGroup, Component, - Relationship, - Capability, LinkMenu, Point, CompositionCiLinkBase @@ -105,16 +97,16 @@ export class CompositionGraphLinkUtils { ); }; - private createSimpleLink = (match:MatchReqToCapability, cy:Cy.Instance, component:Component):void => { + private createSimpleLink = (match:Match, cy:Cy.Instance, component:Component):void => { let newRelation:RelationshipModel = match.matchToRelationModel(); let linkObg:CompositionCiLinkBase = this.linksFactory.createGraphLink(cy, newRelation, newRelation.relationships[0]); this.createLink(linkObg, cy, component); }; - public createLinkFromMenu = (cy:Cy.Instance, chosenMatch:MatchBase, component:Component):void => { + public createLinkFromMenu = (cy:Cy.Instance, chosenMatch:Match, component:Component):void => { if (chosenMatch) { - if (chosenMatch && chosenMatch instanceof MatchReqToCapability) { + if (chosenMatch && chosenMatch instanceof Match) { this.createSimpleLink(chosenMatch, cy, component); } } @@ -128,18 +120,18 @@ export class CompositionGraphLinkUtils { * @param matchesArray * @returns {Array} */ - public filterUcpeLinks(fromNode:CompositionCiNodeBase, toNode:CompositionCiNodeBase, matchesArray:Array):any { + public filterUcpeLinks(fromNode:CompositionCiNodeBase, toNode:CompositionCiNodeBase, matchesArray:Array):any { - let matchLink:Array; + let matchLink:Array; if (fromNode.isUcpePart) { - matchLink = _.filter(matchesArray, (match:MatchBase) => { + matchLink = _.filter(matchesArray, (match:Match) => { return match.isOwner(fromNode.id); }); } if (toNode.isUcpePart) { - matchLink = _.filter(matchesArray, (match:MatchBase) => { + matchLink = _.filter(matchesArray, (match:Match) => { return match.isOwner(toNode.id); }); } @@ -154,14 +146,14 @@ export class CompositionGraphLinkUtils { * @param toNode * @returns {any} */ - public onLinkDrawn(cy:Cy.Instance, fromNode:Cy.CollectionFirstNode, toNode:Cy.CollectionFirstNode):RelationMenuDirectiveObj { + public onLinkDrawn(cy:Cy.Instance, fromNode:Cy.CollectionFirstNode, toNode:Cy.CollectionFirstNode):ConnectRelationModel { if (!this.commonGraphUtils.nodeLocationsCompatible(cy, fromNode, toNode)) { return null; } let linkModel:Array = this.generalGraphUtils.getAllCompositionCiLinks(cy); - let possibleRelations:Array = this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromNode.data().componentInstance, + let possibleRelations:Array = this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromNode.data().componentInstance, toNode.data().componentInstance, linkModel); //filter relations found to limit to specific ucpe-cp @@ -169,8 +161,8 @@ export class CompositionGraphLinkUtils { //if found possibleRelations between the nodes we create relation menu directive and open the link menu if (possibleRelations.length) { - let menuPosition = this.generalGraphUtils.getLinkMenuPosition(cy, toNode.renderedPoint()); - return new RelationMenuDirectiveObj(fromNode.data(), toNode.data(), menuPosition, possibleRelations); + // let menuPosition = this.generalGraphUtils.getLinkMenuPosition(cy, toNode.renderedPoint()); + return new ConnectRelationModel(fromNode.data(), toNode.data(), possibleRelations); } return null; }; @@ -209,7 +201,7 @@ export class CompositionGraphLinkUtils { * @param vfNode */ public createVfToUcpeLink = (component:Component, cy:Cy.Instance, ucpeNode:NodeUcpe, vfNode:CompositionCiNodeVf):void => { - let hostedOnMatch:MatchReqToCapability = this.generalGraphUtils.canBeHostedOn(cy, ucpeNode.componentInstance, vfNode.componentInstance); + let hostedOnMatch:Match = this.generalGraphUtils.canBeHostedOn(cy, ucpeNode.componentInstance, vfNode.componentInstance); /* create relation */ let newRelation = new RelationshipModel(); newRelation.fromNode = ucpeNode.id; @@ -224,13 +216,12 @@ export class CompositionGraphLinkUtils { /** * Handles click event on links. * If one edge selected: do nothing. - /*Two edges selected - always select all - /* Three or more edges: first click - select all, secondary click - select single. + * Two or more edges: first click - select all, secondary click - select single. * @param cy * @param event */ public handleLinkClick(cy:Cy.Instance, event:Cy.EventObject) { - if (cy.$('edge:selected').length > 2 && event.cyTarget[0].selected()) { + if (cy.$('edge:selected').length > 1 && event.cyTarget[0].selected()) { cy.$(':selected').unselect(); } else { @@ -256,7 +247,7 @@ export class CompositionGraphLinkUtils { * @returns {Point} */ public calculateLinkMenuPosition(event, elementWidth, elementHeight):Point { - let point:Point = new Point(event.originalEvent.x, event.originalEvent.y); + let point:Point = new Point(event.originalEvent.clientX, event.originalEvent.clientY); if (event.originalEvent.view.screen.height - elementHeight < point.y) { point.y = event.originalEvent.view.screen.height - elementHeight; } diff --git a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts index 5f717512f5..6a02381902 100644 --- a/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts +++ b/catalog-ui/src/app/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts @@ -18,22 +18,17 @@ * ============LICENSE_END========================================================= */ -import {Requirement, CompositionCiLinkBase, ComponentInstance, CapabilitiesGroup, RequirementsGroup, MatchReqToCapability, MatchBase, - MatchReqToReq,CompositionCiNodeBase, Component, Capability} from "app/models"; +import { + Requirement, CompositionCiLinkBase, CapabilitiesGroup, RequirementsGroup, Match, + CompositionCiNodeBase, Component, Capability +} from "app/models"; +import {ComponentInstance} from "../../../../models/componentsInstances/componentInstance"; /** * Created by obarda on 1/1/2017. */ export class MatchCapabilitiesRequirementsUtils { - constructor() { - } - - public static linkable(requirement1:Requirement, requirement2:Requirement, vlCapability:Capability):boolean { - return MatchCapabilitiesRequirementsUtils.isMatch(requirement1, vlCapability) && MatchCapabilitiesRequirementsUtils.isMatch(requirement2, vlCapability); - }; - - /** * Shows + icon in corner of each node passed in * @param filteredNodesData @@ -77,9 +72,7 @@ export class MatchCapabilitiesRequirementsUtils { }) } - // -------------------------------------------ALL FUNCTIONS NEED REFACTORING---------------------------------------------------------------// - - private static requirementFulfilled(fromNodeId:string, requirement:any, links:Array):boolean { + private static isRequirementFulfilled(fromNodeId:string, requirement:any, links:Array):boolean { return _.some(links, { 'relation': { 'fromNode': fromNodeId, @@ -108,172 +101,97 @@ export class MatchCapabilitiesRequirementsUtils { return false; }; - private getFromToMatches(requirements1:RequirementsGroup, - requirements2:RequirementsGroup, - capabilities:CapabilitiesGroup, - links:Array, - fromId:string, - toId:string, - vlCapability?:Capability):Array { - let matches:Array = new Array(); - _.forEach(requirements1, (requirementValue:Array, key) => { - _.forEach(requirementValue, (requirement:Requirement) => { - if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromId, requirement, links)) { - _.forEach(capabilities, (capabilityValue:Array, key) => { - _.forEach(capabilityValue, (capability:Capability) => { - if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { - let match:MatchReqToCapability = new MatchReqToCapability(requirement, capability, true, fromId, toId); - matches.push(match); - } - }); - }); - if (vlCapability) { - _.forEach(requirements2, (requirement2Value:Array, key) => { - _.forEach(requirement2Value, (requirement2:Requirement) => { - if (!MatchCapabilitiesRequirementsUtils.requirementFulfilled(toId, requirement2, links) && MatchCapabilitiesRequirementsUtils.linkable(requirement, requirement2, vlCapability)) { - let match:MatchReqToReq = new MatchReqToReq(requirement, requirement2, true, fromId, toId); - matches.push(match); - } - }); - }); - } - } - }); - }); - return matches; - } - - private getToFromMatches(requirements:RequirementsGroup, capabilities:CapabilitiesGroup, links:Array, fromId:string, toId:string):Array { - let matches:Array = []; - _.forEach(requirements, (requirementValue:Array, key) => { - _.forEach(requirementValue, (requirement:Requirement) => { - if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(toId, requirement, links)) { - _.forEach(capabilities, (capabilityValue:Array, key) => { - _.forEach(capabilityValue, (capability:Capability) => { - if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { - let match:MatchReqToCapability = new MatchReqToCapability(requirement, capability, false, toId, fromId); - matches.push(match); - } - }); - }); - } - }); - }); - return matches; - } - public getMatchedRequirementsCapabilities(fromComponentInstance:ComponentInstance, toComponentInstance:ComponentInstance, - links:Array, - vl?:Component):Array {//TODO allow for VL array - let linkCapability; - if (vl) { - let linkCapabilities:Array = vl.capabilities.findValueByKey('linkable'); - if (linkCapabilities) { - linkCapability = linkCapabilities[0]; - } - } - let fromToMatches:Array = this.getFromToMatches(fromComponentInstance.requirements, - toComponentInstance.requirements, + links:Array):Array { + let fromToMatches:Array = this.getMatches(fromComponentInstance.requirements, toComponentInstance.capabilities, links, fromComponentInstance.uniqueId, - toComponentInstance.uniqueId, - linkCapability); - let toFromMatches:Array = this.getToFromMatches(toComponentInstance.requirements, + toComponentInstance.uniqueId, true); + let toFromMatches:Array = this.getMatches(toComponentInstance.requirements, fromComponentInstance.capabilities, links, fromComponentInstance.uniqueId, - toComponentInstance.uniqueId); + toComponentInstance.uniqueId, false); return fromToMatches.concat(toFromMatches); } + /***** REFACTORED FUNCTIONS START HERE *****/ + + public getMatches(requirements:RequirementsGroup, capabilities:CapabilitiesGroup, links:Array, + fromId:string, toId:string, isFromTo: boolean):Array { + let matches:Array = []; + let unfulfilledReqs = this.getUnfulfilledRequirements(fromId, requirements, links); + _.forEach(unfulfilledReqs, (req)=> { + _.forEach(_.flatten(_.values(capabilities)), (capability:Capability)=> { + if (MatchCapabilitiesRequirementsUtils.isMatch(req, capability)) { + if(isFromTo) { + matches.push(new Match(req, capability, isFromTo, fromId, toId)); + } else{ + matches.push(new Match(req, capability, isFromTo, toId, fromId)); + } + } + }); + }); + return matches; + } + + public getUnfulfilledRequirements = (fromNodeId:string, requirements:RequirementsGroup, links:Array):Array=> { + + let requirementArray:Array = []; + _.forEach(_.flatten(_.values(requirements)), (requirement:Requirement)=> { + if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.isRequirementFulfilled(fromNodeId, requirement, links)) { + requirementArray.push(requirement); + } + }); + return requirementArray; + }; + /** - * Step I: Check if capabilities of component match requirements of nodeDataArray - * 1. Get component capabilities and loop on each capability - * 2. Inside the loop, perform another loop on all nodeDataArray, and fetch the requirements for each one - * 3. Loop on the requirements, and verify match (see in code the rules) - * - * Step II: Check if requirements of component match capabilities of nodeDataArray - * 1. Get component requirements and loop on each requirement - * 2. - * - * @param component - this is the hovered resource of the left panel of composition screen - * @param nodeDataArray - Array of resource instances that are on the canvas - * @param links -getMatchedRequirementsCapabilities - * @param vl - - * @returns {any[]|T[]} + * Returns true if there is a match between the capabilities and requirements that are passed in + * @param requirements + * @param capabilities + * @returns {boolean} */ - public findByMatchingCapabilitiesToRequirements(component:Component, - nodeDataArray:Array, - links:Array, - vl?:Component):Array {//TODO allow for VL array - let res = []; - - // STEP I - { - let capabilities:any = component.capabilities; - _.forEach(capabilities, (capabilityValue:Array, capabilityKey)=> { - _.forEach(capabilityValue, (capability)=> { - _.forEach(nodeDataArray, (node:CompositionCiNodeBase)=> { - if (node && node.componentInstance) { - let requirements:any = node.componentInstance.requirements; - let fromNodeId:string = node.componentInstance.uniqueId; - _.forEach(requirements, (requirementValue:Array, requirementKey)=> { - _.forEach(requirementValue, (requirement)=> { - if (requirement.name !== "dependency" && MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability) - && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromNodeId, requirement, links)) { - res.push(node); - } - }); - }); - } - }); - }); + public containsMatch = (requirements:Array, capabilities:CapabilitiesGroup):boolean => { + return _.some(requirements, (req:Requirement)=> { + return _.some(_.flatten(_.values(capabilities)), (capability:Capability) => { + return MatchCapabilitiesRequirementsUtils.isMatch(req, capability); }); - } + }); + }; - // STEP II - { - let requirements:any = component.requirements; - let fromNodeId:string = component.uniqueId; - let linkCapability:Array = vl ? vl.capabilities.findValueByKey('linkable') : undefined; + /** + * Returns array of nodes that can connect to the component. + * In order to connect, one of the following conditions must be met: + * 1. component has an unfulfilled requirement that matches a node's capabilities + * 2. node has an unfulfilled requirement that matches the component's capabilities + * 3. vl is passed in which has the capability to fulfill requirement from component and requirement on node. + */ + public findMatchingNodes(component:Component, nodeDataArray:Array, + links:Array):Array //TODO allow for VL array and TEST + { + let componentRequirements:Array = this.getUnfulfilledRequirements(component.uniqueId, component.requirements, links); + return _.filter(nodeDataArray, (node:any)=> { + if (node && node.componentInstance) { + + //Check if component has an unfulfilled requirement that can be met by one of nodes's capabilities (#1) + if (componentRequirements.length && node.category !== 'groupCp' && this.containsMatch(componentRequirements, node.componentInstance.capabilities)) { + return true; - _.forEach(requirements, (requirementValue:Array, requirementKey)=> { - _.forEach(requirementValue, (requirement)=> { - if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromNodeId, requirement, links)) { - _.forEach(nodeDataArray, (node:any)=> { - if (node && node.componentInstance && node.category !== 'groupCp') { - let capabilities:any = node.componentInstance.capabilities; - _.forEach(capabilities, (capabilityValue:Array, capabilityKey)=> { - _.forEach(capabilityValue, (capability)=> { - if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { - res.push(node); - } - }); - }); - if (linkCapability) { - let linkRequirements = node.componentInstance.requirements; - _.forEach(linkRequirements, (value:Array, key)=> { - _.forEach(value, (linkRequirement)=> { - if (!MatchCapabilitiesRequirementsUtils.requirementFulfilled(node.componentInstance.uniqueId, linkRequirement, links) - && MatchCapabilitiesRequirementsUtils.linkable(requirement, linkRequirement, linkCapability[0])) { - res.push(node); - } - }); - }); - } - } - }); + } else { //Check if node has unfulfilled requirement that can be filled by component (#2) + let nodeRequirements:Array = this.getUnfulfilledRequirements(node.componentInstance.uniqueId, node.componentInstance.requirements, links); + if (!nodeRequirements.length) return false; + if (this.containsMatch(nodeRequirements, component.capabilities)) { + return true; } - }); - }); - } - - return _.uniq(res); - }; + } + } + }); + } } MatchCapabilitiesRequirementsUtils.$inject = []; diff --git a/catalog-ui/src/app/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts b/catalog-ui/src/app/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts index ace9d1ce4c..127f43b734 100644 --- a/catalog-ui/src/app/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts +++ b/catalog-ui/src/app/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts @@ -27,6 +27,7 @@ import { ModulesNodesStyle } from "../common/style/module-node-style"; import { GRAPH_EVENTS } from "app/utils"; import { EventListenerService } from "app/services"; import '@bardit/cytoscape-expand-collapse'; +import {AngularJSBridge} from "../../../services/angular-js-bridge-service"; interface IDeploymentGraphScope extends ng.IScope { component: Component; @@ -105,6 +106,7 @@ export class DeploymentGraph implements ng.IDirective { private loadGraph = (scope: IDeploymentGraphScope, el: JQuery) => { let graphEl = el.find('.sdc-deployment-graph-wrapper'); + const imagePath = AngularJSBridge.getAngularConfig().imagesPath; this._cy = cytoscape({ container: graphEl, style: ComponentInstanceNodesStyle.getCompositionGraphStyle().concat(ModulesNodesStyle.getModuleGraphStyle()), @@ -124,8 +126,8 @@ export class DeploymentGraph implements ng.IDirective { fisheye: false, undoable: false, expandCollapseCueSize: 18, - expandCueImage: '/assets/styles/images/resource-icons/' + 'closeModule.png', - collapseCueImage: '/assets/styles/images/resource-icons/' + 'openModule.png', + expandCueImage: imagePath + '/assets/styles/images/resource-icons/' + 'closeModule.png', + collapseCueImage: imagePath + '/assets/styles/images/resource-icons/' + 'openModule.png', expandCollapseCueSensitivity: 2, cueOffset: -20 }); diff --git a/catalog-ui/src/app/directives/graphs-v2/palette/palette.directive.ts b/catalog-ui/src/app/directives/graphs-v2/palette/palette.directive.ts index f46dc6c939..8abf968c82 100644 --- a/catalog-ui/src/app/directives/graphs-v2/palette/palette.directive.ts +++ b/catalog-ui/src/app/directives/graphs-v2/palette/palette.directive.ts @@ -132,7 +132,7 @@ export class Palette implements ng.IDirective { private initLeftPanel(leftPanelComponents:Array, resourceFilterTypes:Array):LeftPanelModel { let leftPanelModel = new LeftPanelModel(); - + if (resourceFilterTypes && resourceFilterTypes.length) { leftPanelComponents = this.leftPanelResourceFilter(leftPanelComponents, resourceFilterTypes); } @@ -171,40 +171,6 @@ export class Palette implements ng.IDirective { this.EventListenerService.notifyObservers(GRAPH_EVENTS.ON_PALETTE_COMPONENT_HOVER_IN, displayComponent); this.$log.debug('palette::onMouseOver:: fired'); - // - // if (this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.containsKey(displayComponent.uniqueId)) { - // this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} found in cache`); - // let cacheComponent:Component = this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.getValue(displayComponent.uniqueId); - // - // //TODO: Danny: fire event to highlight matching nodes - // //showMatchingNodes(cacheComponent); - // return; - // } - // - // this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} not found in cache, initiating server get`); - // // This will bring the component from the server including requirements and capabilities - // // Check that we do not fetch many times, because only in the success we add the component to componentRequirementsAndCapabilitiesCaching - // if (this.fetchingComponentFromServer) { - // return; - // } - // - // this.fetchingComponentFromServer = true; - // this.ComponentFactory.getComponentFromServer(displayComponent.componentSubType, displayComponent.uniqueId) - // .then((component:Component) => { - // this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} fetch success`); - // // this.LeftPaletteLoaderService.updateSpecificComponentLeftPalette(component, scope.currentComponent.componentType); - // this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.setValue(component.uniqueId, component); - // this.fetchingComponentFromServer = false; - // - // //TODO: Danny: fire event to highlight matching nodes - // //showMatchingNodes(component); - // }) - // .catch(() => { - // this.$log.debug('palette::onMouseOver:: component id fetch error'); - // this.fetchingComponentFromServer = false; - // }); - - }; scope.onMouseOut = () => { @@ -226,8 +192,13 @@ export class Palette implements ng.IDirective { private updateLeftPanelDisplay(scope:IPaletteScope) { let entityType:string = scope.currentComponent.componentType.toLowerCase(); let resourceFilterTypes:Array = this.sdcConfig.resourceTypesFilter[entityType]; - scope.components = this.LeftPaletteLoaderService.getLeftPanelComponentsForDisplay(scope.currentComponent); - scope.model = this.initLeftPanel(scope.components, resourceFilterTypes); + scope.components = this.LeftPaletteLoaderService.getLeftPanelComponentsForDisplay(scope.currentComponent); + //remove the container component from the list + let componentTempToDisplay = angular.copy(scope.components); + componentTempToDisplay = _.remove(componentTempToDisplay, function (component) { + return component.component.invariantUUID !== scope.currentComponent.invariantUUID; + }); + scope.model = this.initLeftPanel(componentTempToDisplay, resourceFilterTypes); scope.displaySortedCategories = angular.copy(scope.model.sortedCategories); }; diff --git a/catalog-ui/src/app/directives/graphs-v2/palette/palette.html b/catalog-ui/src/app/directives/graphs-v2/palette/palette.html index 4b123e5777..7f9bfd1e0d 100644 --- a/catalog-ui/src/app/directives/graphs-v2/palette/palette.html +++ b/catalog-ui/src/app/directives/graphs-v2/palette/palette.html @@ -32,7 +32,7 @@ data-ng-repeat="component in components | orderBy: 'displayName' track by $index" data-tests-id={{component.displayName}}>
-
diff --git a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html b/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html index a0a9e4af27..e1cdf499a0 100644 --- a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html +++ b/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html @@ -1,46 +1,46 @@ -